No project description provided
Project description
Elefantolib for FastAPI
NOTE: Only for this library developers. After clone this repository you should run command:
git config core.hooksPath .githooks
Installation
poetry add elefantolib-fastapi
Example
Prepare
- Add environmental variables
SECRET=
ALGORITHM=
ISSUER=
-
Defaults:
- SECRET - not set, this is required
- ALGORITHM=HS256
- ISSUER=Consumer
Create it
- Create a file
main.py
with:
from elefantolib_fastapi.requests import Request
from elefantolib_fastapi.routes import APIRoute
from fastapi import FastAPI
app = FastAPI()
app.router.route_class = APIRoute
@app.get('/')
def index(request: Request):
# TODO something
response = request.pfm.services.some_service_name.get('path-to-endpoint')
return response
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for elefantolib_fastapi-0.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48df78575ecf21003b2e18ce8a2459564f2a97516613d70839fea691c189951e |
|
MD5 | 63b6cd1e0ebe8a9122edd66d3833ece7 |
|
BLAKE2b-256 | bd20ed0c16a29ef5bad129285db6bb29e6f38e58984dab41f57047c202321c86 |
Close
Hashes for elefantolib_fastapi-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8760024f424e3f8fd2d484eb7051f70aba8b1eb2a775c85953e47e785585709 |
|
MD5 | 20c1e3d67514b85ec9c7cb031cb6a081 |
|
BLAKE2b-256 | 76fd0b2fc3f5fc4cf6f6d8188c93db3ac487e7d1ca0ef814978026b3e508e515 |