A simple REST api server illustrating how to use pymacaron
See pymacaron for more information.
- python >= 3.8
Once you have checked out 'pymacaron-helloworld', install dependencies with
pip install -r requirements.txtYou will also need to install redis to correctly run the celery workers:
- For debian distributions:
sudo apt-get install redis - For arch distributions:
sudo pacman -S redisand run the redis server in the background with:
redis-server &Start the server with:
python server.py --port 8080To executing api tests, type in a second terminal window:
pymtestAll pymacaron microservices implement the default routes '/ping', '/version' and '/auth/version', defined here.
The endpoint '/async' calls a task asynchronously via celery. To see it in action, do in one terminal:
python server.py --port 8080In an other terminal:
curl http://127.0.0.1:8080/asyncThe endpoint '/async' calls a task asynchronously via celery. To see it in action, do in one terminal:
python server.py --port 8080In an other terminal:
curl http://127.0.0.1:8080/async