← modules / middleware

CORS

middleware-cors

CORS middleware for Express or NestJS APIs

add it to a devstack project

npx create-devstack-app add middleware-cors

requires one of

  • http:connect
  • http:fastify

Environment

  • ALLOWED_ORIGINS

    Comma-separated origins allowed to call the API, e.g. https://app.example.com