@@ -79,15 +79,15 @@ export function createManagerRouter(
7979
8080 router . use ( "*" , loggerMiddleware ( logger ( ) ) ) ;
8181
82- const cors = runConfig . cors
83- ? corsMiddleware ( runConfig . cors )
84- : createMiddleware ( ( _c , next ) => next ( ) ) ;
82+ if ( runConfig . cors ) {
83+ router . use ( "*" , corsMiddleware ( runConfig . cors ) ) ;
84+ }
8585
8686 // Actor gateway
87- router . use ( "*" , cors , actorGateway . bind ( undefined , runConfig , managerDriver ) ) ;
87+ router . use ( "*" , actorGateway . bind ( undefined , runConfig , managerDriver ) ) ;
8888
8989 // GET /
90- router . get ( "/" , cors , ( c ) => {
90+ router . get ( "/" , ( c ) => {
9191 return c . text (
9292 "This is a RivetKit server.\n\nLearn more at https://rivetkit.org" ,
9393 ) ;
@@ -96,7 +96,6 @@ export function createManagerRouter(
9696 // GET /actors
9797 {
9898 const route = createRoute ( {
99- middleware : [ cors ] ,
10099 method : "get" ,
101100 path : "/actors" ,
102101 request : {
@@ -169,7 +168,6 @@ export function createManagerRouter(
169168 // PUT /actors
170169 {
171170 const route = createRoute ( {
172- cors : [ cors ] ,
173171 method : "put" ,
174172 path : "/actors" ,
175173 request : {
@@ -222,7 +220,6 @@ export function createManagerRouter(
222220 // POST /actors
223221 {
224222 const route = createRoute ( {
225- middleware : [ cors ] ,
226223 method : "post" ,
227224 path : "/actors" ,
228225 request : {
@@ -262,7 +259,6 @@ export function createManagerRouter(
262259 // // DELETE /actors/{actor_id}
263260 // {
264261 // const route = createRoute({
265- // middleware: [cors],
266262 // method: "delete",
267263 // path: "/actors/{actor_id}",
268264 // request: {
@@ -443,7 +439,6 @@ export function createManagerRouter(
443439 router . route (
444440 "/inspect" ,
445441 new Hono < { Variables : { inspector : any } } > ( )
446- . use ( corsMiddleware ( runConfig . inspector . cors ) )
447442 . use ( secureInspector ( runConfig ) )
448443 . use ( ( c , next ) => {
449444 c . set ( "inspector" , managerDriver . inspector ! ) ;
0 commit comments