start
This commit is contained in:
16
api.py
Normal file
16
api.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from fastapi import FastAPI
|
||||
from main import read_temp_water
|
||||
#from main import read_ph
|
||||
import uvicorn
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/get_water_temp")
|
||||
async def read_root():
|
||||
return {"Message": read_temp_water()}
|
||||
|
||||
#@app.get("/get_ph")
|
||||
#async def read_root():
|
||||
# return {"Message": read_ph()}
|
||||
|
||||
if(__name__ == "__main__"):
|
||||
uvicorn.run(app, host='0.0.0.0', port=8000)
|
||||
Reference in New Issue
Block a user