Elffuss BraidHub

kikocis/continue public

main · 719 BRawPermalink
1from fastapi import FastAPI
2
3app = FastAPI()
4
5@app.get("/")
6def read_root():
7 return {"Hello": "World"}
8
9@app.get("/landing")
10def read_landing_page():
11 return {"message": "Welcome to the landing page"}
12
13---
14
15from fastapi import FastAPI, HTTPException
16
17# ... same ...
18
19@app.get("/landing")
20def read_landing_page():
21 raise HTTPException(status_code=404, detail="Page not found")
22
23---
24
25- from fastapi import FastAPI
26+ from fastapi import FastAPI, HTTPException
27
28app = FastAPI()
29
30@app.get("/")
31def read_root():
32 return {"Hello": "World"}
33
34@app.get("/landing")
35def read_landing_page():
36- return {"message": "Welcome to the landing page"}
37+ raise HTTPException(status_code=404, detail="Page not found")