Skip to content

Commit

Permalink
cors error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ambrazasp committed Nov 30, 2023
1 parent 91464f4 commit e3052b0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions services/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ export enum AuthUserRole {
settings: {
port: process.env.PORT || 3000,
path: '/zuvinimasnew',

// Global CORS settings for all routes
cors: {
// Configures the Access-Control-Allow-Origin CORS header.
origin: '*',
// Configures the Access-Control-Allow-Methods CORS header.
methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'DELETE'],
// Configures the Access-Control-Allow-Headers CORS header.
allowedHeaders: '*',
// Configures the Access-Control-Max-Age CORS header.
maxAge: 3600,
},

routes: [
{
path: '',
Expand Down

0 comments on commit e3052b0

Please sign in to comment.