File size: 454 Bytes
5fd64c7
 
 
98de9a2
5fd64c7
 
 
98de9a2
 
 
 
5fd64c7
 
98de9a2
5fd64c7
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
import uvicorn
from fastapi import FastAPI
from fastapi.responses import RedirectResponse

app = FastAPI(docs_url=None, redoc_url="/")

@app.get("/")
def redirect_to_oneapi():
    return RedirectResponse(url="http://localhost:8080/")

@app.get("/status")
def hello():
    return {"message": "OneApi is running on port 8080", "oneapi_url": "http://localhost:8080/"}
    
if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=7860)