Question 9 of 10Pro Only

What is CORS and how do you configure it correctly for a REST API?

Sample answer preview

CORS, Cross-Origin Resource Sharing, is a security mechanism that controls how resources from one server can be requested from another domain. By default, browsers block cross-origin requests for security reasons. CORS allows defining exceptions.

Access-Control-Allow-OriginpreflightOPTIONScredentialssame-origin

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 9+ more Backend Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime