Skip to content

Commit

Permalink
🔧 Fix Example Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Drake Costa authored and Drake Costa committed May 2, 2019
1 parent 20d2398 commit 348ad9d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { types } from "./types"
import { resolvers } from "./resolvers"
import { defaultQuery } from "./defaultQuery"

const endpoint = {
host: `localhost`,
port: 4000
}
const host = process.env.HOSTNAME

const endpoint = host
? `https://${host.replace(`sse-sandbox-`, ``)}.sse.codesandbox.io`
: `localhost:9000`

const server = new ApolloServer({
schema: makeExecutableSchema({
Expand All @@ -21,7 +22,7 @@ const server = new ApolloServer({
playground: {
tabs: [
{
endpoint: `${endpoint.host}:${endpoint.port}`,
endpoint,
query: defaultQuery
}
]
Expand Down

0 comments on commit 348ad9d

Please sign in to comment.