initial api
This commit is contained in:
commit
40e744cb7c
2 changed files with 41 additions and 0 deletions
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY app.py .
|
||||
|
||||
RUN pip install fastapi uvicorn
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
32
app.py
Normal file
32
app.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
VERSION = "0.1.0"
|
||||
|
||||
@app.get("/")
|
||||
def root():
|
||||
return {
|
||||
"service": "senaya-api",
|
||||
"status": "running"
|
||||
}
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {
|
||||
"status": "ok"
|
||||
}
|
||||
|
||||
@app.get("/version")
|
||||
def version():
|
||||
return {
|
||||
"version": VERSION
|
||||
}
|
||||
|
||||
@app.get("/info")
|
||||
def info():
|
||||
return {
|
||||
"name": "senaya-api",
|
||||
"purpose": "base service slot for senaya infrastructure",
|
||||
"version": VERSION
|
||||
}
|
||||
Loading…
Reference in a new issue