UNPKG

get-express-starter

Version:

Get production ready express boilerplate with a single command

12 lines (9 loc) 358 B
import { env } from './env'; import type { CorsOptions } from 'cors'; 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'], };