Commit 145023da authored by yann300's avatar yann300

use cors

parent 9e6f599f
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
"color-support": "^1.1.3", "color-support": "^1.1.3",
"commander": "^2.19.0", "commander": "^2.19.0",
"cors": "^2.8.5",
"ethereumjs-util": "^5.1.2", "ethereumjs-util": "^5.1.2",
"ethereumjs-vm": "3.0.0", "ethereumjs-vm": "3.0.0",
"express": "^4.16.3", "express": "^4.16.3",
......
const express = require('express') const express = require('express')
const cors = require('cors')
const bodyParser = require('body-parser') const bodyParser = require('body-parser')
const app = express() const app = express()
const expressWs = require('express-ws') const expressWs = require('express-ws')
...@@ -14,6 +15,7 @@ class Server { ...@@ -14,6 +15,7 @@ class Server {
start (host, port) { start (host, port) {
expressWs(app) expressWs(app)
app.use(cors())
app.use(bodyParser.urlencoded({extended: true})) app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json()) app.use(bodyParser.json())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment