1.0.5 • Published 4 years ago
@chatpta/starter-api-express v1.0.5
Express starter api application serves JSON
Create express api application
npx @chatpta/starter-api-express my-apiTo run application in docker compose,
Express runs at localhost:3000 and postgres runs at localhost:5432
docker-compose -f docker-compose.yaml upStart postgres database in container, available at host port 5432
docker-compose up db-starter-api-expressTest connection to db
psql "postgresql://user:password@localhost/chatpta_db"Run application
npm install
npm run devstartRun test in watch mode with postgres db connection
npm run testRun test in watch mode WITHOUT postgres db connection
npm run testWithoutDbRun the build script to do all of above
./buildRun database migration to create database tables
npm run migrateDb