forked from simran142002/dalgo-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
# main.py | ||
from fastapi import FastAPI | ||
import uvicorn | ||
import argparse | ||
|
||
app = FastAPI() | ||
def create_app(): | ||
app = FastAPI() | ||
|
||
@app.get("/healthcheck") | ||
def healthcheck(): | ||
return {"status": "ok"} | ||
@app.get("/healthcheck") | ||
def healthcheck(): | ||
return {"status": "ok"} | ||
|
||
# You can add more endpoints here as needed | ||
return app | ||
|
||
if __name__ == "__main__": | ||
|
||
parser = argparse.ArgumentParser(description="FastAPI Machine Learning API") | ||
parser.add_argument("--port", type=int, default=8000, help="Port number to bind the FastAPI application") | ||
args = parser.parse_args() | ||
|
||
uvicorn.run("main:create_app", host="127.0.0.1", port=args.port, reload=True) |