Answers for "allow cookies sent by the client"

0

allow cookies sent by the client

const express = require("express")
const cors = require("cors");
const app = express();

app.use(cors({
  origin : http://localhost:3000 (Whatever your frontend url is) 
  credentials: true, // <= Accept credentials (cookies) sent by the client
})

app.use("/api/whatever/the/endpoint", yourRouter);
Posted by: Guest on July-20-2021

Code answers related to "allow cookies sent by the client"

Browse Popular Code Answers by Language