irt-service/app/main.py
2021-09-04 23:50:22 -04:00

31 lines
734 B
Python

from fastapi import FastAPI, __version__
from pydantic import BaseModel
from typing import Set, List, Optional, Dict
from models.solver_content import SolverContent
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Welcome to Measures LOFT solver service. v0.1"}
@app.get("/healthcheck")
async def health():
content = {
"maintainer": "Meazure Horizon Team",
"git_repo": "https://github.com/yardstick/measure-solver",
"server": "OK",
"fastapi version": __version__,
"app version": "0.1.1"
}
return content
@app.get('/readycheck')
async def ready():
return 'OK' # just means we're on air
@app.post('/solve/')
async def solve(solver_content: SolverContent):
return solver_content