File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/convex-helpers/server Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,10 @@ export type CorsConfig = {
84
84
export type RouteSpecWithCors = RouteSpec & CorsConfig ;
85
85
86
86
/**
87
- * An HttpRouter with built in cors support.
88
- */
87
+ * An HttpRouter with built in cors support.
88
+ */
89
89
export type CorsHttpRouter = {
90
- http : HttpRouter
90
+ http : HttpRouter ;
91
91
route : ( routeSpec : RouteSpecWithCors ) => void ;
92
92
} ;
93
93
@@ -96,7 +96,10 @@ export type CorsHttpRouter = {
96
96
* @param allowedOrigins An array of allowed origins for CORS.
97
97
* @returns A function to use instead of http.route when you want CORS.
98
98
*/
99
- export const corsRouter = ( http : HttpRouter , corsConfig ?: CorsConfig ) : CorsHttpRouter => {
99
+ export const corsRouter = (
100
+ http : HttpRouter ,
101
+ corsConfig ?: CorsConfig ,
102
+ ) : CorsHttpRouter => {
100
103
const allowedExactMethodsByPath : Map < string , Set < string > > = new Map ( ) ;
101
104
const allowedPrefixMethodsByPath : Map < string , Set < string > > = new Map ( ) ;
102
105
return {
You can’t perform that action at this time.
0 commit comments