mirror of
https://github.com/scratchfoundation/restify-cors-middleware.git
synced 2024-12-19 12:22:23 -05:00
20 lines
370 B
JavaScript
20 lines
370 B
JavaScript
|
var restify = require('restify');
|
||
|
|
||
|
//
|
||
|
// For now, delegate to restify.CORS
|
||
|
//
|
||
|
// Although there's a few things we could fix
|
||
|
// around Access-Control-Expose-Headers
|
||
|
//
|
||
|
// It would also break the cyclic dependency with Restify :)
|
||
|
//
|
||
|
|
||
|
exports.handler = function(options) {
|
||
|
|
||
|
return restify.CORS({
|
||
|
origins: options.origins,
|
||
|
headers: options.exposeHeaders
|
||
|
});
|
||
|
|
||
|
};
|