https://github.com/mebeim/middleware_project
📚 Middleware technologies for distributed systems exam project.
https://github.com/mebeim/middleware_project
rest rest-api rest-server rest-service restful-api
Last synced: about 1 month ago
JSON representation
📚 Middleware technologies for distributed systems exam project.
- Host: GitHub
- URL: https://github.com/mebeim/middleware_project
- Owner: mebeim
- License: apache-2.0
- Archived: true
- Created: 2020-03-12T14:01:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T11:27:45.000Z (over 4 years ago)
- Last Synced: 2025-02-15T15:35:12.194Z (3 months ago)
- Topics: rest, rest-api, rest-server, rest-service, restful-api
- Language: Python
- Homepage:
- Size: 87.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
REST-JPG
========[![Build status][github-actions-image]][github-actions-url]
[![license][license-image]][license-url]Course project for the course
[052533 - Middleware Technologies For Distributed Systems][project-course] held
in the autumn semester of 2020 at [Politecnico di Milano][polimi].Documentation
-------------Documentation for the REST API is available through Postman [**here**][api-doc]*. Browse examples online or try it out using [Postman's native app][postman-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`][license-url] for further reference.[github-actions-url]: https://github.com/mebeim/middleware_project/actions
[github-actions-image]: https://github.com/mebeim/middleware_project/workflows/CI/badge.svg?branch=master
[license-url]: https://github.com/mebeim/middleware_project/blob/master/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache%202.0-green
[project-course]: https://www11.ceda.polimi.it/schedaincarico/schedaincarico/controller/scheda_pubblica/SchedaPublic.do?&evn_default=evento&c_classe=694795&polij_device_category=DESKTOP&__pj0=0&__pj1=7908374dbcd5f0ff305b0e84491f033b
[polimi]: https://www.polimi.it/
[api-doc]: https://documenter.getpostman.com/view/12652042/TVCmQjJz
[postman-app]: https://www.postman.com/downloads/