importwaitOnfrom'wait-on'importappfrom'./config/app'importserverfrom'./config/apollo'constport=process.env.PORTconstoptions={resources:['tcp:4001'],}waitOn(options).then(()=>{server.applyMiddleware({app})app.listen({port},()=>{console.log(`Server ready at http://localhost:${port}${server.graphqlPath}`)})}).catch((err)=>{console.error('ERR:',err)})
Give this a try!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Easy solution to the development problem I referenced is to use wait-on in index.js before building the gateway rather than in the command line.
This way when nodemon restarts the gateway server it waits for the other services on every restart, not just the first time we run the command.
Thought I'd mention this for anyone who ran into the same problem.
Hi, can you give an example on how you solved this? I'm facing the same issue but can't make it work.
Give this a try!