Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-04-29 20:46:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e07192970241d0742bf7a6374d0b6ce630c16686
e0719297
1 parent
7edb5894
add PubSub
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
back/src/server.js
back/src/server.js
View file @
e071929
import
dotenv
from
"dotenv"
;
dotenv
.
config
();
import
{
GraphQLServer
}
from
"graphql-yoga"
;
import
{
GraphQLServer
,
PubSub
}
from
"graphql-yoga"
;
import
morgan
from
"morgan"
;
import
schema
from
"./schema"
;
import
"./passport"
;
...
...
@@ -8,9 +8,11 @@ import { authenticateJWT } from "./passport";
const
PORT
=
process
.
env
.
PORT
;
const
pubsub
=
new
PubSub
();
const
server
=
new
GraphQLServer
({
schema
,
context
:
({
request
})
=>
({
request
}),
context
:
({
request
})
=>
({
request
,
pubsub
}),
});
server
.
express
.
use
(
morgan
(
"dev"
));
...
...
Please
register
or
login
to post a comment