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 ElefantoRequest
from elefantolib_fastapi.routes import ElefantoRoute
from fastapi import FastAPI
app = FastAPI()
app.router.route_class = ElefantoRoute
@app.get('/')
def index(request: ElefantoRequest):
# 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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cc4b86f63a4750f37f297d948dd0327c9ed506d9ed8dd822e4e695e12bf30f0 |
|
MD5 | 5f1b7c9f437231f8d7bcb96d16d9e51f |
|
BLAKE2b-256 | a6ce0523b020eaf0a6a8a4048b2e4b7184e5999e2678ca76d46985b341c35529 |
Close
Hashes for elefantolib_fastapi-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ad618d56202ab214e417e390feef8ef809f5e218b7610bab0c24efe04284b8f |
|
MD5 | b7d9845e86714f6fe673120bec508eb4 |
|
BLAKE2b-256 | 33779fc9b169494b590a7b67c47815064d3b5aeeaa3af47fa130dd28a6e33bab |