Skip to content

Commit

Permalink
refactor(api): use cors for dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Dec 10, 2023
1 parent bcc2a2a commit 2b4cad7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/api/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const corsOptionsDelegate = function (req, callback) {
methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
};

if (['dev', 'test', 'local'].includes(process.env.NODE_ENV) || isWidgetRoute(req.url) || isBlueprintRoute(req.url)) {
if (['test', 'local'].includes(process.env.NODE_ENV) || isWidgetRoute(req.url) || isBlueprintRoute(req.url)) {
corsOptions.origin = '*';
} else {
corsOptions.origin = [process.env.FRONT_BASE_URL];
Expand Down

0 comments on commit 2b4cad7

Please sign in to comment.