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.2.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a4e30c72af5dcf5a4b8b987218631803cb17d9957d8971675838e7d7f80ea1 |
|
MD5 | 992e8d976c286e6f1b9a174d2eb9b31b |
|
BLAKE2b-256 | f2076b3e9be7425fbf76391634405b8c794d7fa3a6bca7f2238da9ebe60f3483 |
Close
Hashes for elefantolib_fastapi-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1ff927e4a5f789d4444a64162b646e67aeed7a2d40f26d2bdbc3c8e5dc71507 |
|
MD5 | a34cdeb4800bc33ce61aa80e1cf84214 |
|
BLAKE2b-256 | fc36883291a67eebe6abe3f34f0c586d6f46d627d4e2597e42f1e6025eef5253 |