September 2017
Intermediate to advanced
450 pages
11h 24m
English
Let's walk through reading and writing headers in Express to implement CORS headers and language locale preferences using the Accept-Languages header:
...router.options('*', function (req, res, next) { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,PATCH,OPTIONS'); res.header('Access-Control-Allow-Headers', 'Content- Type, Authorization, Content-Length, X-Requested- With'); res.send(200);});...
Read now
Unlock full access