git ssb

0+

cel-desktop / ssb-pkg



Tree: e9d9dec1d00ff365112ca0f981bbda15e3682528

Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / 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