Skip to content

Commit

Permalink
lesson 5 code update
Browse files Browse the repository at this point in the history
  • Loading branch information
iamshaunjp committed Mar 6, 2018
1 parent 1a4fc58 commit a1df106
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const express = require('express');
const graphqlHTTP = require('express-graphql');

const app = express();

// bind express with graphql
app.use('/graphql', expressGraphQL({
app.use('/graphql', graphqlHTTP({
// pass in a schema property
}))
}));

app.listen(4000, () => {
console.log('now listening for requests on port 4000');
Expand Down

2 comments on commit a1df106

@nethikarsairam42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi ,
am getting error message as below when am executing above code.

:\Graphql-playlist\Server>nodemon app
[nodemon] 2.0.4
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node app.js
G:\Graphql-playlist\Server\app.js:8
app.use('/graphql', graphqlHTTP({
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1054:16)
at Module._compile (internal/modules/cjs/loader.js:1102:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
[nodemon] app crashed - waiting for file changes before starting...

@nethikarsairam42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please help me ASAP

Please sign in to comment.