first commit
This commit is contained in:
17
index.js
Normal file
17
index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// server.js
|
||||
const express = require('express');
|
||||
const expressGraphql = require('express-graphql');
|
||||
const app = express();
|
||||
|
||||
const schema = require('./schema/user');
|
||||
app.use('/graphql', expressGraphql({
|
||||
schema,
|
||||
graphiql: true
|
||||
}));
|
||||
|
||||
app.get('/', (req, res) => res.end('index'));
|
||||
|
||||
app.listen(8000, (err) => {
|
||||
if(err) {throw new Error(err);}
|
||||
console.log('*** server started ***');
|
||||
});
|
||||
Reference in New Issue
Block a user