Files
2017-06-07 12:17:14 -07:00

22 lines
568 B
JavaScript

/**
* Copyright (c) Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
const express = require('express');
const graphqlHTTP = require('express-graphql');
const schema = require('./schema');
const app = express();
app.use(express.static(__dirname));
app.use('/graphql', graphqlHTTP(() => ({ schema, graphiql: true })));
app.listen(0, function() {
const port = this.address().port;
console.log(`Started on http://localhost:${port}/`);
});