Express runs but does not work. JS Node

Asked

Viewed 91 times

0

Good afternoon everyone, I’m having a little problem with the server express in a Node JS application with typescript, typeorm and postgres SQL where when executing the command npm run dev the server starts normally but when trying to run the routes with Insomnia Rest it returns the message as if the server is not running, but in the terminal the server continues running normally. The problem began to occur after the refactoring of models and creation of new routes in the application.

Message displayed in India

Error: Couldn’t connect to server

Note: when trying to access routes through the browser it doesn’t even return cannot: get/.

Script no Package.json

"scripts": {
    "test": "jest",
    "dev": "nodemon -L --watch 'src/' --exec 'ts-node --files src/server.ts' -e ts",
    "typeorm": "ts-node-dev node_modules/typeorm/cli"
  },
}

1 answer

0


Problem solved ! after spending a few hours cracking your head, reviewing the code among others with the help of friends found that the problem was not related to the code but rather to a conflict of processes in my development environment that was solved with a simple action that was restarting the computer making the system operational to terminate these conflicting processes and when rebooting the system the application returned to work normally. NOTE: we could not identify which specific process was causing the problem but we suspect it is something related to the database running in the Docker container.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.