Browse Source

Merge branch 'master' of git://github.com/SuperNETorg/iguana

all-modes
Petr Balashov 8 years ago
parent
commit
6f9f0647a1
  1. BIN
      assets/bin/osx/iguana
  2. 4
      main.js
  3. 6
      routes/shepherd.js

BIN
assets/bin/osx/iguana

Binary file not shown.

4
main.js

@ -59,8 +59,8 @@ process.once('loaded', () => {
}
});
guiapp.use(bodyParser.json()); // support json encoded bodies
guiapp.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies
guiapp.use(bodyParser.json({limit: '50mb'})); // support json encoded bodies
guiapp.use(bodyParser.urlencoded({limit: '50mb', extended: true})); // support encoded bodies
guiapp.get('/', function (req, res) {
res.send('Iguana app server');

6
routes/shepherd.js

@ -158,8 +158,8 @@ shepherd.get('/groom', function(req, res, next) {
var _filename = req.query.filename;
if (_filename) {
if (fs.existsSync(iguanaDir + '/shepherd/data-' + _filename + '.json')) {
fs.readFile(iguanaDir + '/shepherd/data-' + _filename + '.json', 'utf8', function (err, data) {
if (fs.existsSync(iguanaDir + '/shepherd/cache-' + _filename + '.json')) {
fs.readFile(iguanaDir + '/shepherd/cache-' + _filename + '.json', 'utf8', function (err, data) {
if (err) {
var errorObj = {
'msg': 'error',
@ -210,7 +210,7 @@ shepherd.post('/groom', function(req, res) {
res.end(JSON.stringify(errorObj));
} else {
fs.writeFile(iguanaDir + '/shepherd/data-' + _filename + '.json', _payload, function (err) {
fs.writeFile(iguanaDir + '/shepherd/cache-' + _filename + '.json', _payload, function (err) {
if (err) {
var errorObj = {
'msg': 'error',

Loading…
Cancel
Save