Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.
/ middleware_project Public archive

📚 Middleware technologies for distributed systems exam project.

License

Notifications You must be signed in to change notification settings

mebeim/middleware_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST-JPG

Build status license

Course project for the course 052533 - Middleware Technologies For Distributed Systems held in the autumn semester of 2020 at Politecnico di Milano.

Documentation

Documentation for the REST API is available through Postman here*. Browse examples online or try it out using Postman's native app.

* Link may expire after course final grading.

Running the server

Development

In development mode, the server creates a new volatile database and save images inside the container only. All data is lost on shutdown. The server will listen for HTTP connections on port 80.

To run in this mode, first build with docker-compose build and then run the server service passing --test as first argument.

$ docker-compose build
$ docker-compose run --service-ports --rm server --test

Production

In production mode, the server uses the DB present at ./db/db.sqlite (if not present, a new one is created) and saves images in the ./images directory. Data persists after shutdown. The server will listen for HTTPS connections on port 443, using the HTTPS certificates provided in the ./https folder.

$ docker-compose up -d

Testing

Unit tests are implemented in the tests/ folder. To run tests, start the server in development mode and then start the test.py script from within the test/ directory.

$ docker-compose run --service-ports --rm server --test

# in another shell
$ cd test
$ pip3 install --user -r requirements.txt # if needed
$ ./test.py

NOTE: the test_client.py is used to test OAuth functionality, it will create a temporary HTTP server listening on port 9999 for this purpose when token generation tests are run.


This project is distributed under the terms of the Apache License v2.0. See file LICENSE for further reference.

About

📚 Middleware technologies for distributed systems exam project.

Topics

Resources

License

Stars

Watchers

Forks