RESTful API to support the Movie App with Express, Concurrently + Nodemon and PostgreSQL integration
- you'll need a psql database configured first
- get to building then try it out! or check on prod
# install packages
npm install
# hot-load for development
npm run dev
# build for production -> /dist
npm run build
# run service
npm run start
- dev hot-loading: Concurrently package is used to simultaneously watch and compile files on change and restart the server
- dotenv package is required for node apps to read
.env
variables - REST arch:
- setting up diagnostics for database execution
- Best Practices for Node.js Development
- Typed requests
- having to return
next(err)
for every route was a PITA, so i upgraded to beta Express5 which includes middleware that automatically callsnext
when errors are thrown -- more info
- set up a local database server
- your
.env
file should look something like this: 5432 is the default but it might be different if you have multiple psql instances
PORT=5555
DB_USER=
DB_PASSWORD=
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=
- db errors still crash the server -- add handling (test by removing a param that's expected in args)
- make a user request obj with validation like in title.ts
- absolute paths in express is different...
- add validation/param standardization
- add auth
- check out express middlewares
- upgrade to Express5 from beta when that comes out
- check this out
- docker db for local?
- add exception handling and return meaningful json errors
- wire up each proc to and endpoint and test
- write a postman collection