@@ -158,15 +158,15 @@ Add a new API route to an existing FastAPI project.
158158#### Syntax
159159
160160``` console
161- $ fastkit addroute PROJECT_NAME ROUTE_NAME [OPTIONS]
161+ $ fastkit addroute ROUTE_NAME [PROJECT_DIR] [OPTIONS]
162162```
163163
164164#### Arguments
165165
166166| Argument | Description | Required |
167167| ----------| -------------| ----------|
168- | ` PROJECT_NAME ` | Name of the existing project | Yes |
169168| ` ROUTE_NAME ` | Name of the new route (plural recommended) | Yes |
169+ | ` PROJECT_DIR ` | Project directory under your workspace (defaults to ` . ` , the current directory) | No |
170170
171171#### Options
172172
@@ -179,7 +179,8 @@ $ fastkit addroute PROJECT_NAME ROUTE_NAME [OPTIONS]
179179<div class =" termy " >
180180
181181``` console
182- $ fastkit addroute my-api users
182+ $ cd my-api
183+ $ fastkit addroute users
183184 Adding New Route
184185┌──────────────────┬──────────────────────────────────────────┐
185186│ Project │ my-api │
@@ -194,6 +195,16 @@ Do you want to add route 'users' to project 'my-api'? [Y/n]: y
194195
195196</div >
196197
198+ You can also target a project under your workspace by name without ` cd ` -ing into it:
199+
200+ <div class =" termy " >
201+
202+ ``` console
203+ $ fastkit addroute users my-api
204+ ```
205+
206+ </div >
207+
197208#### Generated Files
198209
199210Creates these files in the project:
@@ -456,10 +467,10 @@ $ fastkit runserver
456467<div class =" termy " >
457468
458469``` console
459- # Add multiple routes
460- $ fastkit addroute my-api users
461- $ fastkit addroute my-api products
462- $ fastkit addroute my-api orders
470+ # Add multiple routes (project name as second positional arg = workspace project)
471+ $ fastkit addroute users my-api
472+ $ fastkit addroute products my-api
473+ $ fastkit addroute orders my-api
463474
464475# Test the API
465476$ fastkit runserver
631642EOF
632643
633644 cd " $service -service"
634- fastkit addroute " $service -service " " $service "
645+ fastkit addroute " $service "
635646 cd ..
636647done
637648```
0 commit comments