/ justapi / examples / 01_hello_world.py
swadhinbiswas docs(examples): add 10 progressive tutorial examples and test project · 7/9/2026
b48e461
15 lines · 283 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from justapi import JustAPIApp

app = JustAPIApp()

@app.get("/")
def read_root():
    return {"Hello": "World"}

@app.get("/items/{item_id}")
def read_item(item_id: int):
    return {"item_id": item_id, "name": "Item Name"}

if __name__ == "__main__":
    app.run("127.0.0.1:8000")