Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elefantolib_fastapi-0.9.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

elefantolib_fastapi-0.9.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page