Implement transaction handling
This commit is contained in:
parent
161c6aa027
commit
a65dee8962
16 changed files with 331 additions and 94 deletions
22
app/main.py
22
app/main.py
|
@ -1,13 +1,20 @@
|
|||
from fastapi import FastAPI, Request
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import JSONResponse
|
||||
from dotenv import load_dotenv
|
||||
from fastapi import FastAPI
|
||||
from starlette.middleware.authentication import AuthenticationMiddleware
|
||||
import uvicorn
|
||||
|
||||
load_dotenv()
|
||||
|
||||
from app.database import engine, Base
|
||||
from app.models import *
|
||||
|
||||
from app.routers import chargepoint_v1, id_token_v1, ocpp_v1, user_v1
|
||||
from app.routers import (
|
||||
chargepoint_v1,
|
||||
id_token_v1,
|
||||
meter_value_v1,
|
||||
ocpp_v1,
|
||||
transaction_v1,
|
||||
user_v1
|
||||
)
|
||||
from app.util.websocket_auth_backend import BasicAuthBackend
|
||||
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
@ -29,11 +36,10 @@ def create_app():
|
|||
app.include_router(chargepoint_v1.router, prefix="/v1")
|
||||
app.include_router(id_token_v1.router, prefix="/v1")
|
||||
app.include_router(user_v1.router, prefix="/v1")
|
||||
app.include_router(meter_value_v1.router, prefix="/v1")
|
||||
app.include_router(transaction_v1.router, prefix="/v1")
|
||||
app.mount(path="/v1/ocpp", app=create_ocpp_app())
|
||||
|
||||
return app
|
||||
|
||||
app = create_app()
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000, log_level="info")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue