-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (19 loc) · 1.04 KB
/
index.js
File metadata and controls
22 lines (19 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var graphql = require('graphql');
var graphqlHTTP = require('express-graphql');
var express = require('express');
var articleSchema = require('./schemas/articleSchema');
var authorSchema = require('./schemas/authorSchema');
var teamSchema = require('./schemas/teamSchema');
var playerSchema = require('./schemas/playerSchema');
var matchSchema = require('./schemas/matchSchema');
var actionSchema = require('./schemas/actionSchema');
var actionTypeSchema = require('./schemas/actionTypeSchema');
var app = express();
app.use('/authors', graphqlHTTP({ schema: authorSchema, pretty: true }));
app.use('/articles', graphqlHTTP({ schema: articleSchema, pretty: true }));
app.use('/teams', graphqlHTTP({ schema: teamSchema, pretty: true }));
app.use('/players', graphqlHTTP({ schema: playerSchema, pretty: true }));
app.use('/matches', graphqlHTTP({ schema: matchSchema, pretty: true }));
app.use('/actions', graphqlHTTP({ schema: actionSchema, pretty: true }));
app.use('/actionTypes', graphqlHTTP({ schema: actionTypeSchema, pretty: true }));
app.listen(3000);