Boilerplate for create a Node.js API write in typescript include docker-compose for development mode and a Dockerfile to build production image.
# install dependencies
npm install
# serve watching changes in src at localhost:3000
npm run dev
# install dependencies
npm install
# serve watching changes in src at localhost:3000
docker-compose up
knexFile.development.connection.host = 'yourhost'
knexFile.development.connection.database = 'yourdatabase'
knexFile.development.connection.user = 'youruser'
knexFile.development.connection.password = 'yourpassword'
# install dependencies
npm install
# run all test in `src/test`
npm run test
import { isLoggingIn } from '${relativeRoute}/middlewares/auth'
/*
In the init method you can create routes, to make a route protected just add the `isLoggingIn` middleware in the first position.
*/
init() {
this.router.get('/me', isLogginIn, this.me)
}