-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c1c382
commit ab1efcf
Showing
8 changed files
with
490 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:11.14.0-alpine | ||
|
||
RUN apk add \ | ||
ca-certificates \ | ||
musl-dev | ||
|
||
ADD dist/ /graphql-voyager/dist/ | ||
ADD middleware/ /graphql-voyager/middleware/ | ||
ADD src/ /graphql-voyager/src/ | ||
ADD package.json /graphql-voyager/package.json | ||
ADD docker-image/package.json /graphql-voyager/docker-image/package.json | ||
ADD docker-image/package-lock.json /graphql-voyager/docker-image/package-lock.json | ||
|
||
RUN npm install | ||
|
||
ADD docker-image/index.js /graphql-voyager/docker-image/index.js | ||
|
||
WORKDIR /graphql-voyager/ | ||
|
||
WORKDIR /graphql-voyager/docker-image/ | ||
|
||
RUN npm install | ||
|
||
ENV PORT=3001 | ||
|
||
CMD node index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const express = require('express'); | ||
const voyager = require('graphql-voyager/middleware'); | ||
|
||
const app = express(); | ||
|
||
app.use('/', voyager.express({ endpointUrl: process.env.GRAPHQL_ENDPOINT })); | ||
|
||
process.on('SIGINT', function () { | ||
console.log("\nGracefully shutting down from SIGINT (Ctrl-C)"); | ||
process.exit(1); | ||
}); | ||
|
||
const port = process.env.PORT; | ||
|
||
app.listen(port, function(err) { | ||
if (err) { | ||
throw new Error( | ||
`Failed to start listening on ${port}, error: ${err.message}` | ||
); | ||
} | ||
console.log(`listening on http://0.0.0.0:${port}`); | ||
}); |
Oops, something went wrong.