Skip to content

Instantly share code, notes, and snippets.

@gpbaculio
Created September 22, 2017 23:45
Show Gist options
  • Save gpbaculio/d7abbf71f838719608a7145d95c649d2 to your computer and use it in GitHub Desktop.
Save gpbaculio/d7abbf71f838719608a7145d95c649d2 to your computer and use it in GitHub Desktop.
var app = express();
const indexPath = path.join(__dirname, './public/index.html')
const publicPath = express.static(path.join(__dirname, './public'))
app.use('/public', publicPath)
app.use('/graphql', graphQLHTTP({graphiql: true, schema, pretty: true})); // graphql endpoint
app.get('/', function (_, res) { res.sendFile(indexPath) });
let http = require('http');
let server = http.createServer(app);
server.listen(4000, () => console.log("app in 4000"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment