Weather API built with NodeJS, Express, JWT, Mongoose.
- Install NodeJS https://nodejs.org/en/
- Install dependencies
npm install
- Locate the repository in bash
- Run
npm install
in the repo folder - Run
node index
(ORnodemon index
for hot reloading) in the repo folder - Open Postman (or similar application) and send
GET
request to http://localhost:8080/
- Locate the repository in bash
- Run
docker build -t weather-api .
to build image - Run
docker run -p PORT:8080 -d weather-api
to run image to container - Run
docker ps
to verify if image is running - Open Postman (or similar application) and send
GET
request to http://0.0.0.0:PORT/
- Send
GET
request to/login
to retrieve authorization token (<access_token>
) - Send
GET
request to/weather
with a header keyAuthorization
with the valueBearer <access_token>
- NodeJS - Javascript runtime environment
- Express - NodeJS web framework
- JWT - JSON Web Token library
- Mongoose - MongoDB Object Data Modeling (ODM) library
- OpenWeatherAPI - Data API
- Irvin Ives Lau - lauirvin
- https://www.irviniveslau.com