diff --git a/src/index.ts b/src/index.ts index 03dbebe..55da25c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -287,11 +287,11 @@ export class Router { public cors(config?: RouterCorsConfig): Router { this.corsEnabled = true this.corsConfig = { - allowOrigin: config?.allowOrigin || '*', - allowMethods: config?.allowMethods || '*', - allowHeaders: config?.allowHeaders || '*', - maxAge: config?.maxAge || 86400, - optionsSuccessStatus: config?.optionsSuccessStatus || 204 + allowOrigin: config?.allowOrigin ?? '*', + allowMethods: config?.allowMethods ?? '*', + allowHeaders: config?.allowHeaders ?? '*', + maxAge: config?.maxAge ?? 86400, + optionsSuccessStatus: config?.optionsSuccessStatus ?? 204 } return this }