- Clone this repository
git clone https://github.com/CitlaliSC/NodeJs-back-end-AP.git- Install dependencies
npm i- Create a .env file with the following info:
- SERVER_PORT=3000
- DB_HOST=localhost
- DB_PORT=3306
- DB_USER=admin
- DB_PASSWORD=pass123
- DB_NAME=patientsdb
- DB_CONNECTION_LIMIT=20
- SERVER_PORT= 5000
- Create docker container
docker-compose up -d For testing docker and mysql:
docker exec -it mysqlcontainer mysql -uroot -ppass123To run in dev:
npm run start:devNote: If you are running this on Windows, you may need to adapt the following lines in your
package.jsonscripts, as setting environment variables differs from Linux:"scripts": { "start:dev": "NODE_ENV=dev nodemon src/index.js", "start:prod": "NODE_ENV=production node src/index.js" }