mirror of
https://github.com/expo/graphiql.git
synced 2026-11-14 19:10:19 -10:00
22 lines
568 B
JavaScript
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}/`);
|
|
});
|