![]() ![]() Expects a comma-delimited string (ex: 'GET,PUT,POST') or an array (ex: ). methods: Configures the Access-Control-Allow-Methods CORS header.The function takes the request origin as the first parameter and a callback (called as callback(err, origin), where origin is a non-function value of the origin option) as the second. ![]() Function - set origin to a function implementing some custom logic.For example will accept any request from " " or from a subdomain of "". Array - set origin to an array of valid origins.For example the pattern /example\.com$/ will reflect any request that is coming from an origin ending with "". If it's a match, the request origin will be reflected. RegExp - set origin to a regular expression pattern which will be used to test the request origin.For example if you set it to "" only requests from " " will be allowed. String - set origin to a specific origin.Boolean - set origin to true to reflect the request origin, as defined by req.header('Origin'), or set it to false to disable CORS.origin: Configures the Access-Control-Allow-Origin CORS header.Var express = require ( 'express' ) var cors = require ( 'cors' ) var app = express ( ) var corsOptions = ) Configuration Options ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |