-
Notifications
You must be signed in to change notification settings - Fork 11
Home
Sergey Tregub edited this page Sep 30, 2018
·
23 revisions
Welcome to the AspNet-WebApi wiki!
Quote from an MDN article:
Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin. A web application makes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, and port) than its own origin.
By default, all origins are allowed. You can set up origin by uncommenting this line in web.config. To specify more than one origin split them by semicolon.
For example:
<appSettings>
<add key="allowed-origins" value="http://localhost:5000; https://api.some-domain.com"/>
</appSettings>
If you want more control you can adjust CORS-policy in App_Start/CorsConfig.cs.
More information can be found here.
Content
- Getting Started
- Using PackageReference instead of package.config
- Cross-Origin Resource Sharing (CORS)
- Dependency Injection
- Automapper
- Logging
- Cache control
- Unhandled exceptions logging
- Unhandled exceptions handling
- Content formatting
- Using environment variables in configuration options
- Documenting API
- Using EntityFramework