UNPKG

get-express-starter

Version:

Get production ready express boilerplate with a single command

12 lines (9 loc) 364 B
import type { CorsOptions } from 'cors'; import { env } from './env'; const allowedOrigins = process.env.NODE_ENV === 'production' ? env.frontend.url : '*'; export const corsOptions: CorsOptions = { origin: allowedOrigins, credentials: true, // methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], // allowedHeaders: ['Content-Type', 'Authorization'], };