-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set up HTTPS with ApolloServer 2? #1155
Comments
I tried this, and it "appears" to work, but I'd like a sanity check if possible: const app = express() |
That works great! |
Thanks Evan... now I'm off to setting up the Subscription Server. I'll open another issue for that. It's clear that Server 2.0 is a huge improvement. Thanks for all you do. |
It's now documented and in the latest release! In the beta.11, we moved to an Subscriptions are now created in this manner: https://glitch.com/edit/#!/mountainous-suggestion?path=index.js:49:0 |
When trying to follow the latest docs, I'm getting this error:
I believe this ticket should be reopened as there is no documentation on how to enable HTTPS on an ApolloServer |
I thought one of the matras of AP2, is that it dramatically simplifies necessary dependencies and configuration? |
Ahh, have just noticed, that you need to use |
Apollo server (apollo-server) itself uses apollo-server-express. And as such, it support SSL/TLS. https://www.apollographql.com/docs/apollo-server/essentials/server.html#ssl Scott |
@smolinari how do you set this up? |
@bionicles You can follow the example here: https://www.apollographql.com/docs/apollo-server/security/terminating-ssl/ to setup an apollo server over HTTPS. However it uses As you can see in |
I want to run apollo via https locally to use cookies with Secure attribute or SameSite attribute set to None. The only difference I see in my code is that I use app.listen instead of server.listen because server does not have a listen function. (Property 'listen' does not exist on type 'ApolloServer'.) This looks like an error in the documentation. Update:
|
This comment has been minimized.
This comment has been minimized.
Source : https://www.apollographql.com/docs/apollo-server/security/terminating-ssl/
|
I'm probably missing something very obvious, but I cannot figure out how to configure HTTPS with ApolloServer…
With vanilla express, I do the following:
var https_options = {
key: key,
cert: cert
};
server = https.createServer(https_options, app).listen(PORT, HOST);
With ApolloServer, I don't seem to have the
option to configure the key and cert:
const app = express()
const server = new ApolloServer({ typeDefs, resolvers })
registerServer({ server, app })
server.listen().then(({ url }) => {
console.log(
🚀 Server ready at ${url}
)})
The text was updated successfully, but these errors were encountered: