typescript-express-starter icon indicating copy to clipboard operation
typescript-express-starter copied to clipboard

Connection error with Knex template

Open Salnika opened this issue 3 years ago โ€ข 3 comments

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 mysqlsolves 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

Salnika avatar Sep 20 '21 14:09 Salnika

Any update on this ? @ljlm0402

Salnika avatar Dec 07 '21 14:12 Salnika

@Salnika

We sincerely apologize for the delay in development. We will check later and take action. thank you.

ljlm0402 avatar Dec 08 '21 01:12 ljlm0402

@Salnika its been a while, but is this what you were seeing? image

I was only able to replicate this using Node 17. It works fine on node 16. image

I can change DB_HOST = localhost to DB_HOST = 127.0.0.1 to make it work for Node 17 image

More details here: #158

julschong avatar Apr 12 '22 10:04 julschong