Skip to content

Commit d29e0c2

Browse files
Fix api.py template - use JSONResponse instead of dict
1 parent 657cc00 commit d29e0c2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from raystack.compat import APIRouter
1+
from raystack.compat import APIRouter, JSONResponse
22

33

44
router = APIRouter()
@@ -8,5 +8,5 @@ router = APIRouter()
88

99
# Example:
1010
@router.get("/example")
11-
def example():
12-
return {"message": "text"}
11+
def example(request):
12+
return JSONResponse({"message": "text"})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from raystack.compat import JSONResponse
2+
3+
# Create your views here.
4+
5+
def home_view(request):
6+
return JSONResponse({"message": "Welcome to Raystack", "framework": "Raystack"})

0 commit comments

Comments
 (0)