@firebolt-dev/cors

The @firebolt-dev/cors package is a plugin for implementing CORS and allowing requests from external origins.

firebolt.config.js
import cors from '@firebolt-dev/cors' export const config = { plugins: [ cors({ /* options */ }), ], }

By default (with no options) all external requests are allowed.

Options

PropertyDefaultTypeDescription
origin'*'String | String[] | (origin:String) => StringThe value of "Access-Control-Allow-Origin" CORS header.
allowMethodsAllString[]The value of "Access-Control-Allow-Methods" CORS header.
allowHeaders[]String[]The value of "Access-Control-Allow-Headers" CORS header.
maxAgeNumberThe value of "Access-Control-Max-Age" CORS header.
credentialsBooleanThe value of "Access-Control-Allow-Credentials" CORS header.
exposeHeaders[]String[]The value of "Access-Control-Expose-Headers" CORS header.