Skip to content

apigram/HospitalWaiterMealService

Repository files navigation

HospitalWaiterMealService

RESTful API for the HospitalWaiter Patient and Staff applications to interface with a SQL database.

Deployment for development/testing

It is best to run the microservice using a virtual Python environment (virtualenv). The following steps assume the creation of a virtual python environment

  1. Clone this repository into your document root folder for your web server.
  2. Create a Python virtual environment by using the virtualenv command (eg. virtualenv venv)
  3. Start the virtual environment.
  4. From the command-line, run pip install -r requirements.txt. This will install all required dependencies.
  5. Set the following environment variables using the SET command:
    • SECRET_KEY - The secret key used for token authentication. This should be the same secret key used for the SSO microservice.
    • MAIL_USER - The username of the server's email
    • MAIL_PASSWORD - Email password.
    • DATABASE_URL - The URL of the database to interface with. This should include the schema, host, port and password where applicable.
  6. Set the FLASK_APP environment variable to "MealService.py".
  7. Run the following command: flask run -p [PORT] (where [PORT] is the port from which to run the microservice. This defaults to 5000 but may need to change if multiple microservices are running from the same machine). This will start the server.

API specification

The following endpoints are available:

Endpoint URL Available actions
/mealservice/meal GET, POST
/mealservice/meal/<id> GET, PUT, DELETE
/mealservice/meal/<id>/patient GET
/mealservice/meal/<id>/requirement GET, POST
/mealservice/meal/<id>/requirement/<id> DELETE
/mealservice/patient GET, POST
/mealservice/patient/<id> GET, PUT, DELETE
/mealservice/patient/<id>/requirement GET, POST
/mealservice/patient/<id>/requirement/<id> DELETE
/mealservice/patient/<id>/meal GET, POST
/mealservice/patient/<id>/meal/<id> DELETE
/mealservice/requirement GET, POST
/mealservice/requirement/<id> GET, PUT, DELETE
/mealservice/requirement/<id>/meal GET
/mealservice/requirement/<id>/patient GET

All of the above endpoints require an Authorization header containing a token generated by the HospitalWaiter SSO microservice.

About

RESTful API for the HospitalWaiter app to interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published