joyent-portal/cloudapi-graphql/src/index.js

21 lines
377 B
JavaScript
Raw Normal View History

2016-10-10 18:37:26 +03:00
const express = require('express');
const graphqlHTTP = require('express-graphql');
const schema = require('./schema');
const app = express();
app.use('/graphql', graphqlHTTP(() => ({
schema: schema,
graphiql: true,
pretty: true
})));
app.listen(3000, (err) => {
if (err) {
console.log(err);
throw err;
}
console.log('Listening at localhost:3000');
});