typescript-express-starter
typescript-express-starter copied to clipboard
Connection error with Knex template
Describe the Bug (๋ฒ๊ทธ ์ค๋ช )
When I run the knex template (with docker compose up
) I cant call routes like POST:/users without receiving ECONNREFUSED 127.0.0.1:3306
. By looking the issue https://github.com/ljlm0402/typescript-express-starter/pull/98 and the PR linked to it. I notice that by updating development.json
db configuration file host from 127.0.0.1
to mysql
solves the issue. But with this configuration it's impossible to run migration.
Version to Reproduce (ํ์ฌ ์ฌ์ฉํ ๋ฒ์ )
With docker
Steps to Reproduce (์ฌํ ์์)
1: Start the project with default configuration with docker
2: Run npm run migrate
-> success
3: Try to create a user with POST:/users -> error ECONNREFUSED
4: docker compose down
5: update db configuration development.json replace host: "localhost"
to host: "mysql"
6: run npm run migrate
-> ECONNREFUSED
7: Try to create a user with POST:/users -> Route is accessible
I tried to be as clear as possible, dont hesitate if I missed something Thanks
Any update on this ? @ljlm0402
@Salnika
We sincerely apologize for the delay in development. We will check later and take action. thank you.
@Salnika its been a while, but is this what you were seeing?
I was only able to replicate this using Node 17. It works fine on node 16.
I can change DB_HOST = localhost
to DB_HOST = 127.0.0.1
to make it work for Node 17
More details here: #158