Skip to content

Commit

Permalink
Accept incoming CORS.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneearth committed Feb 26, 2018
1 parent 964f8ec commit 663f18d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
9 changes: 6 additions & 3 deletions src/utilities/Server.js
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down

0 comments on commit 663f18d

Please sign in to comment.