O'Reilly logo

Building APIs with Node.js by Caio Ribeiro Pereira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

©  Caio Ribeiro Pereira 2016

Caio Ribeiro Pereira, Building APIs with Node.js , 10.1007/978-1-4842-2442-7_11

11. Preparing the Production Environment

Caio Ribeiro Pereira

(1)São Vicente - SP, São Paulo, Brazil

Cross-origin resource sharing (CORS) is an important HTTP mechanism. It is responsible for allowing or denying asynchronous requests from other domains.

CORS , in practice, includes only the HTTP headers that are included on the server side. Those headers can indicate which domain can consume the API, which HTTP methods are allowed, and, mainly, which endpoints can be shared publicly for applications from other domains to consume. Generally when implementing CORS in a browser, each cross-origin request will be preceded by an OPTIONS request ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required