Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ozanonurtek/metrobi
Metrobi Tasks
https://github.com/ozanonurtek/metrobi
Last synced: 5 days ago
JSON representation
Metrobi Tasks
- Host: GitHub
- URL: https://github.com/ozanonurtek/metrobi
- Owner: ozanonurtek
- Created: 2020-08-09T20:11:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-02T15:06:15.000Z (over 2 years ago)
- Last Synced: 2023-03-07T14:39:19.682Z (almost 2 years ago)
- Language: Python
- Size: 87.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Metrobi Challenges
- I have created a Sanic app with open api documentation using swagger to serve tasks as a simple API.
## Installation
- Clone this repository
- Go to base directory of the repository than create a virtualenvironment with following command `python3 -m venv venv`
and install requirements `pip install -r requirements.txt`
- Activate the venv, for Linux or OSX run: `source venv/bin/activate` for windows run: `venv\Scripts\activate.bat`## Running
- To start sanic, run: `python run.py`, it will start on port http://0.0.0.0:5000/
- Go to swagger docs: http://0.0.0.0:5000/swagger## Explanation
- I created example app with app factory design pattern and blueprints. Sanic has two blueprints `hello` and `questions`.
In `__init__.py` file of blueprints module, there is a `create_app()` method which creates and application instance to serve.
I learnt this pattern while developing Flask applications, which helps me a lot in terms of multiple applications.
[Detailed information about this pattern](https://flask.palletsprojects.com/en/1.1.x/patterns/appfactories/)