Spaces:
Sleeping
Sleeping
Ronio Jerico Roque commited on
Commit ·
b99cd1e
1
Parent(s): 9cc761f
initial commit
Browse filesFiles changed (3)
- DockerfileAdded+10
- app.pyAdded+18
- requirements.txtAdded+4
12345678910FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD python app.py123456789101112131415161718import osfrom fastapi import FastAPI
app = FastAPI()
@app.get("/")async def read_root(): return {"message": "Hello from the root!"}
@app.get("/test")async def read_test(): return {"message": "Hello from the test endpoint!"}
if __name__ == "__main__": import uvicorn # Use the PORT environment variable provided by Hugging Face, default to 7860 port = int(os.environ.get("PORT", "7860")) uvicorn.run(app, host="0.0.0.0", port=port)1234fastapiuvicornfastapi-mcppydanticDockerfileAdded+10
app.pyAdded+18
requirements.txtAdded+4