git ssb

0+

cel-desktop / ssb-pkg



Tree: 8f4b43a09aab9801bf28987edd59c2e366180327

Files: 8f4b43a09aab9801bf28987edd59c2e366180327 / test / test-79-npm / cors / cors.js

404 bytesRaw
1'use strict';
2
3var cors = require('cors');
4var req = { method: 'OPTIONS', headers: { } };
5var res = { headers: {}, getHeader: function (name) {
6 return this.headers[name];
7}, setHeader: function (name, value) {
8 this.headers[name] = value;
9}, end: function () {
10 if (res.headers['Access-Control-Allow-Origin'] === '*') {
11 console.log('ok');
12 }
13} };
14
15var middleware = cors();
16middleware(req, res);
17

Built with git-ssb-web