File tree 3 files changed +11
-7
lines changed
3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ async fn main() {
132
132
debug ! ( trunk_bin_path = ?trunk_path, trunk_version = ?trunk_version) ;
133
133
134
134
// build our application with a single route
135
- let app = Router :: new ( )
135
+ let api = Router :: new ( )
136
136
. route ( "/hello" , get ( hello) )
137
137
. route ( "/run" , post ( run) )
138
138
. layer (
@@ -141,8 +141,9 @@ async fn main() {
141
141
. timeout ( Duration :: from_secs ( 10 ) ) ,
142
142
)
143
143
. layer ( GlobalConcurrencyLimitLayer :: new ( 1 ) )
144
- . layer ( TraceLayer :: new_for_http ( ) )
145
- . layer ( CorsLayer :: permissive ( ) ) ;
144
+ . layer ( TraceLayer :: new_for_http ( ) ) ;
145
+
146
+ let app = Router :: new ( ) . nest ( "/api" , api) ;
146
147
147
148
let addr = SocketAddr :: new ( "0.0.0.0" . parse ( ) . unwrap ( ) , * PORT ) ;
148
149
info ! ( "Server running on {}" , addr) ;
Original file line number Diff line number Diff line change 9
9
" **/target/**"
10
10
],
11
11
"rewrites" : [
12
- {
13
- "source" : " **" ,
14
- "destination" : " /index.html"
15
- },
16
12
{
17
13
"source" : " /api/**" ,
18
14
"run" : {
19
15
"serviceId" : " playground-backend" ,
20
16
"region" : " us-west1"
21
17
}
18
+ },
19
+ {
20
+ "source" : " **" ,
21
+ "destination" : " /index.html"
22
22
}
23
23
]
24
24
},
Original file line number Diff line number Diff line change
1
+ [[proxy ]]
2
+ backend = " http://localhost:3000/api"
3
+
1
4
[[hook ]]
2
5
stage = " build"
3
6
command = " npm"
You can’t perform that action at this time.
0 commit comments