26 lines
496 B
Python
26 lines
496 B
Python
import os
|
|
from fastapi import FastAPI
|
|
|
|
APP_NAME = os.getenv("APP_NAME", "analytics")
|
|
APP_VERSION = os.getenv("APP_VERSION", "1.0.0")
|
|
ROOT_PATH = os.getenv("ROOT_PATH", "")
|
|
|
|
app = FastAPI(
|
|
title=APP_NAME,
|
|
version=APP_VERSION,
|
|
root_path=ROOT_PATH
|
|
)
|
|
|
|
@app.get("/health")
|
|
def health():
|
|
return {"status": "ok"}
|
|
|
|
@app.get("/version")
|
|
def version():
|
|
return {
|
|
"app": APP_NAME,
|
|
"version": APP_VERSION,
|
|
"language": "python",
|
|
"root_path": ROOT_PATH
|
|
}
|