I've been working through a tutorial on using express
and have come across the following routes:
module.exports = function(app) {
app.use(function(req, res, next) {
res.header(
"Access-Control-Allow-Headers",
"x-access-token, Origin, Content-Type, Accept"
);
next();
});
app.post(
'/api/auth/signup',
[
verifySignUp.checkDuplicateUsernameOrEmail,
verifySignUp.checkRolesExist
],
controller.signup
);
app.post('/api/auth/signin', controller.signin);
};
Can someone explain, in simple terms, what these headers are for and why they're included in the response? I thought headers were typically set with a request.
I also tried running the app without including these headers and it worked fine. So, I'm not sure about their purpose.