Skip to content

pymacaron/pymacaron-helloworld

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

pymacaron-helloworld

A simple REST api server illustrating how to use pymacaron

See pymacaron for more information.

Requirements

  • python >= 3.8

Start the server and run tests

Once you have checked out 'pymacaron-helloworld', install dependencies with

pip install -r requirements.txt

You 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 redis

and run the redis server in the background with:

redis-server &

Start the server with:

python server.py --port 8080

To executing api tests, type in a second terminal window:

pymtest

All pymacaron microservices implement the default routes '/ping', '/version' and '/auth/version', defined here.

Asynchronous task

The endpoint '/async' calls a task asynchronously via celery. To see it in action, do in one terminal:

python server.py --port 8080

In an other terminal:

curl http://127.0.0.1:8080/async

Authentication

The endpoint '/async' calls a task asynchronously via celery. To see it in action, do in one terminal:

python server.py --port 8080

In an other terminal:

curl http://127.0.0.1:8080/async

About

A simple microservice based on pymacaron

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages