The project allows to get the current temperature in the requested city.
This is a simple project that demonstrates how to use RabbitMQ. To simplify, a file with cities and their coordinates was used instead of a database.
- Clone repo and run
npm i
-
Create .env file (like '.env example'). You also need yandex_weather_api_key
-
Run docker with RabbitMQ:
docker run -d -p 5672:5672 rabbitmq
- Run server:
node server.js
- Run service:
node weather.js
Now we can test it by sending request
$ curl http://localhost:{PORT}/cities/astana
- Move logic from server.js to controller.