nikgraf / graphql-apollo-client-course

54 stars 30 forks source link

Following the instructions with no success #5

Closed zz-james closed 5 years ago

zz-james commented 5 years ago

When I type npm run start:slow the app crashes...

`➜ server git:(master) ✗ npm run start:slow

server@0.1.0 start:slow /Users/james/Projects/egghead/server NODE_ENV=development nodemon index.js 1400

[nodemon] 1.19.1 [nodemon] to restart at any time, enter rs [nodemon] watching: . [nodemon] starting node index.js 1400 events.js:183 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE :::4000 at Object._errnoException (util.js:1022:11) at _exceptionWithHostPort (util.js:1044:20) at Server.setupListenHandle [as _listen2] (net.js:1367:14) at listenInCluster (net.js:1408:12) at Server.listen (net.js:1492:7) at resolve (/Users/james/Projects/egghead/server/node_modules/apollo-server/dist/index.js:75:28) at new Promise () at ApolloServer. (/Users/james/Projects/egghead/server/node_modules/apollo-server/dist/index.js:73:19) at Generator.next () at /Users/james/Projects/egghead/server/node_modules/apollo-server/dist/index.js:7:71 [nodemon] app crashed - waiting for file changes before starting...`

it says there's something running on 4000, which I don't think there is, but anyway as a start how do I change the port number the server starts on?

many thanks

zz-james commented 5 years ago

ok found it in server/index.js line 47, so hardcoded mine to 8000 for now

server.listen({port:8000}).then(({ url }) => { console.log(🚀 Server ready at ${url}); });