@@ -8,19 +8,17 @@ import { route } from '@stacksjs/router'
8
8
* @see https://stacksjs.org/docs/routing
9
9
*/
10
10
11
- // $APP_URL/api
12
- await route . get ( '/' , ( ) => 'hello world' )
13
-
14
- // $APP_URL/ api/welcome
15
- await route . get ( '/welcome' , ( ) => {
11
+ await route . get ( '/' , ( ) => 'hello world' ) // $APP_URL/api
12
+ await route . get ( '/hello/world ' , ( ) => 'hello world, buddy' ) // stacksjs.org/api/hello/world
13
+ await route . get ( '/buddy/versions' , 'Actions/Buddy/VersionsAction' ) // stacksjs.org/api/buddy/versions
14
+ await route . get ( '/buddy/commands' , 'Actions/Buddy/CommandsAction' ) // stacksjs.org/ api/buddy/commands
15
+ await route . get ( '/welcome' , ( ) => { // $APP_URL/api/welcome
16
16
return { // you may return an object as well
17
17
data : 'hello world, friend' ,
18
18
}
19
19
} )
20
20
21
- await route . get ( '/hello/world' , ( ) => 'hello world, buddy' ) // stacksjs.org/api/hello/world
22
- await route . get ( '/buddy/versions' , 'Actions/Buddy/VersionsAction' )
23
- await route . get ( '/buddy/commands' , 'Actions/Buddy/CommandsAction' )
21
+ await route . health ( ) // adds an `/api/health` route
24
22
25
23
// await route.group('/buddy', async () => { // you may group your routes in a few different ways
26
24
// await route.get('/commands', 'Actions/Buddy/CommandsAction')
@@ -35,5 +33,3 @@ await route.get('/buddy/commands', 'Actions/Buddy/CommandsAction')
35
33
36
34
// await route.action('/example') // the equivalent of route.get('/example', 'ExampleAction')
37
35
// await route.job('/example-two') // the equivalent of route.get('/example-two', 'ExampleTwoJob')
38
-
39
- await route . health ( ) // adds an `/api/health` route
0 commit comments