Skip to content

Instantly share code, notes, and snippets.

@kingisaac95
Created September 19, 2017 13:07
Show Gist options
  • Save kingisaac95/16a4e29ce1e9268bd4024d430753621f to your computer and use it in GitHub Desktop.
Save kingisaac95/16a4e29ce1e9268bd4024d430753621f to your computer and use it in GitHub Desktop.
DMS Server v1
const express = require('express');
const bodyParser = require('body-parser');
// handle graphql request and response based on schema
const { graphqlExpress } = require('apollo-server-express');
const schema = require('./schema');
let app = express();
app.use('/graphql', bodyParser.json(), graphqlExpress({ schema }));
const PORT = process.env.PORT || 3200;
app.listen(PORT, () => {
console.log(`DMS app running on port ${PORT}.`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment