I am following a tutorial for express
with 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);
};
In layman's terms what do these headers do and why are they included in the response? I thought headers were set as part of a request.
I have also tried the app with the headers removed and it functions fine, so not sure what the use is.