Enhances configuration page

Adds Notification angular module
Adds Requestify for ExpressJS to make posting ezpz
Now can post data to gocryptoCore
GoCrypto can now receive data on settings save
This commit is contained in:
Scott
2016-08-08 14:52:25 +10:00
parent 16982e36ae
commit e85876e273
9 changed files with 152 additions and 46 deletions

View File

@@ -1,9 +1,14 @@
var express = require('express')
, app = express();
var requestify = require('requestify');
var bodyParser = require('body-parser')
var request = require('request');
var path = __dirname + '/app/';
app.use("/bower_components", express.static(path + '/bower_components'));
app.use( bodyParser.json() );
app.get("/",function(req,res){
res.sendFile(path + "index.html");
@@ -29,6 +34,22 @@ app.get('/config/all', function (req, res) {
////////////////////////////////////////////////////////
// Posts
///////////////////////////////////////////////////////
app.post('/config/all/save', function(req, res) {
requestify.post('http://localhost:9050/config/all/save', {
data: req.body
})
.then(function(response) {
console.log(response);
res.send(response);
});
});
app.listen(80, function(){
console.log('CORS-enabled web server listening on port 80');
console.log('GoCyptoTrader website running! Enter http://localhost/ into browser');
});