Skip to content

Commit

Permalink
set cors options to try with posthog (credetntials)
Browse files Browse the repository at this point in the history
  • Loading branch information
if22b088 committed Aug 26, 2024
1 parent b5d438e commit 741f92b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ const posthog = new PostHog(
var todosRouter = require('./routes/todos');

var app = express();
app.use(cors());
const corsOptions = {
origin: '*', // Allow requests only from your frontend's origin
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], // Allow these HTTP methods
allowedHeaders: ['Content-Type', 'Authorization'], // Allow these headers
credentials: true // Allow credentials if you are using them (e.g., cookies, authentication)
};
app.use(cors(corsOptions));

// view engine setup
app.set('views', path.join(__dirname, 'views'));
Expand Down

0 comments on commit 741f92b

Please sign in to comment.