A base API Project Structure
- Semantic versioning
You can add your own variables on environment.ts config file (similar to Angular environments file)
For a scalable, testable and maintainable code, we suggest you use: TDD (Test Driven Design) or DDD (Domain Driven Design).
You can add all your node application routes in: this._router.use(); on api.ts
Or import your routes file to api.ts and add its at router.use()
,
ej.:
this._router.use(new myCustomRoutes().configRoutes());
Where configRoutes method return express.Router (configRoutes(): Router)
You should create your .key and .crt files on /src/cers directory (webpack move it at build)
openssl req -x509 -newkey rsa:4086 -nodes -sha256 -keyout api.key -out api.crt