Skip to content

Instantly share code, notes, and snippets.

@StevenLangbroek
Forked from clayallsopp/graphql_1.js
Last active August 29, 2015 14:24
Show Gist options
  • Save StevenLangbroek/cbc308dd14b3cc717e70 to your computer and use it in GitHub Desktop.
Save StevenLangbroek/cbc308dd14b3cc717e70 to your computer and use it in GitHub Desktop.
// index.js
// by requiring `babel/register`, all of our successive `require`s will be Babel'd
require('babel/register');
require('./server.js');
// server.js
import express from 'express';
let app = express();
const PORT = 3000;
app.post('/graphql', (req, res) => {
res.send('Hello!');
});
let server = app.listen(PORT, () => {
const { address: host, port } = server.address();
console.log(`GraphQL listening at http://${host+port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment