The purpose of this project is to gain some practical experience on how to build an basic API server with Express.js, by achieving the following tasks:
- build up basic routes (including query params and route params)
- understand middlewares
- handle errors correctly
- re-structure the project
- init the project and install express
npm init --yes npm i express
- build up an express server
- setup the routes (fetch the data from openweathermap)
- extract routes into separate modules
- PORT
- use of dotenv
- Helmet
- Morgan
- Winston
- Create axios instance
- Create models
- Response formatter
- Error handling
- Country code check
- Handle CORS problem
- uncaughtException and unhandledRejection
- Swagger
- pm2
- heroku