Last active
February 10, 2016 17:11
-
-
Save clayallsopp/06310aa327ee5802e248 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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