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-09 16:38:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ad391c0828c86f58eb5b8df5467c112737f1ab2f
ad391c08
1 parent
945a2e59
update server.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
back/src/server.js
back/src/server.js
View file @
ad391c0
import
{
GraphQLServer
}
from
"graphql-yoga"
;
import
dotenv
from
"dotenv"
;
dotenv
.
config
();
import
{
GraphQLServer
}
from
"graphql-yoga"
;
import
morgan
from
"morgan"
;
import
schema
from
"./schema"
;
const
PORT
=
process
.
env
.
PORT
||
4000
;
const
typeDefs
=
`
type Query {
hello(name: String): String
}
`
;
const
PORT
=
process
.
env
.
PORT
;
const
resolvers
=
{
Query
:
{
hello
:
()
=>
"hello"
,
},
};
const
server
=
new
GraphQLServer
({
schema
});
const
server
=
new
GraphQLServer
({
typeDefs
,
resolvers
}
);
server
.
express
.
use
(
morgan
(
"dev"
)
);
server
.
start
(()
=>
console
.
log
(
`server is running : http://localhost:
${
PORT
}
`
));
...
...
Please
register
or
login
to post a comment