diff --git a/package.json b/package.json index 104a018..2e8c9bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "BITBOX", - "version": "0.1.7", + "version": "0.1.8", "description": "A development framework for Bitcoin Cash", "main": "main.js", "productName": "BITBOX", @@ -35,6 +35,7 @@ "bitcoinjs-message": "^2.0.0", "body-parser": "^1.18.2", "chai": "^4.1.2", + "cors": "^2.8.4", "css-loader": "^0.28.9", "electron": "^1.7.12", "electron-packager": "^10.1.2", diff --git a/src/utilities/Server.js b/src/utilities/Server.js index 173a71c..7f01aa9 100644 --- a/src/utilities/Server.js +++ b/src/utilities/Server.js @@ -1,17 +1,20 @@ import BitcoinCash from './BitcoinCash' import Bitcoin from 'bitcoinjs-lib'; -let Store = require('electron-store'); +import Store from 'electron-store'; const store = new Store(); -const express = require('express'); +import express from 'express'; +import cors from 'cors'; + import axios from 'axios'; -let bodyParser = require('body-parser'); +import bodyParser from 'body-parser'; class Server { constructor() { const server = express(); let port = 8332; + server.use(cors()); server.use(bodyParser.json()); // support json encoded bodies server.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies server.post('/', (req, res) => {