forked from ChoruOfficial/ExocoreDefaultTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
44 lines (32 loc) · 1.02 KB
/
index.py
File metadata and controls
44 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
== Default FastAPI Template ==
Created with care by: @ChoruOfficial (John Steve Costaños)
This template offers a solid and straightforward foundation.
It's designed to be a versatile starting point,
ready for you to build upon and customize for your projects.
#Btw this template is default only
"""
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from paths_routes import generate_and_save_routes
PORT = 5000
app = FastAPI()
@app.get("/home")
def home():
return JSONResponse({"message": "Welcome to the API"})
@app.post("/signin")
def signin():
return JSONResponse({"message": "Signed in"})
@app.post("/signup")
def signup():
return JSONResponse({"message": "Signed up"})
@app.get("/profile")
def profile():
return JSONResponse({"message": "User profile"})
@app.delete("/logout")
def logout():
return JSONResponse({"message": "Logged out"})
if __name__ == "__main__":
import uvicorn
generate_and_save_routes(app, port=PORT)
uvicorn.run(app, host="0.0.0.0", port=PORT)