mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 23:16:51 +00:00
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:
@@ -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');
|
||||
});
|
||||
Reference in New Issue
Block a user