Skip to content

Commit 39e99e0

Browse files
committed
cors in proxy
1 parent 41bb39c commit 39e99e0

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

lib/server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ const express = require('express')
22
const app = express()
33
const netApi = require('./proxy.js')
44
const port = process.env.PORT || 8080
5+
const cors = require('cors')
56

7+
app.use(cors())
68
app.use(netApi({ allowOrigin: '*' }))
79

810
app.use("/proxyCheck",(req,res,next)=>{

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"child_process": "^1.0.2",
3838
"compression": "^1.7.4",
3939
"constants-browserify": "^1.0.0",
40+
"cors": "^2.8.5",
4041
"crypto": "^1.0.1",
4142
"crypto-browserify": "^3.12.0",
4243
"decompress": "^4.2.1",

0 commit comments

Comments
 (0)