Skip to content

Instantly share code, notes, and snippets.

@clayallsopp
Last active February 10, 2016 17:11
Show Gist options
  • Save clayallsopp/06310aa327ee5802e248 to your computer and use it in GitHub Desktop.
Save clayallsopp/06310aa327ee5802e248 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();
let PORT = 3000;
app.post('/graphql', (req, res) => {
res.send('Hello!');
});
let server = app.listen(PORT, function () {
let host = server.address().address;
let port = server.address().port;
console.log('GraphQL listening at http://%s:%s', host, port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment