HTTP headers are a common way for web servers to share information about their content with other servers and web applications. Reading and writing headers can be necessary for a variety of web server needs, including cross-origin resource sharing (CORS).
Working with headers in Express
Getting ready
Let's use HTTP headers to enhance our Express route configurations. For our API routes, we will add headers to enable CORS via pre-flight OPTIONS requests. This will come in handy if we ever need to run our API on a different domain than our Angular web application.
For our Angular routes, we will read the incoming Accept-Language header and parse it into a locale property that we can inject into our index.html file&apos...