Skip to content

Commit 46bffe7

Browse files
Add missing routes, improve hook
1 parent 58bfea3 commit 46bffe7

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

hooks/post_gen_project.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
remove_paths.append("app/routes")
1818
else:
1919
remove_paths.append("app/controllers")
20+
remove_paths.append("app/views")
2021

2122
for possible_format in {"toml", "yaml", "ini", "json"}:
2223
if (
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from typing import List
2+
3+
from blacksheep import get, post
4+
5+
6+
@get("/api/examples")
7+
async def get_examples() -> List[str]:
8+
return list(f"example {i}" for i in range(3))
9+
10+
11+
@post("/api/examples")
12+
async def add_example(self, example: str):
13+
"""
14+
Adds an example.
15+
"""

0 commit comments

Comments
 (0)