Browse Source

shepherd api groom calls fixed, payload size increased (doesn't work), updated iguana binary for osx

all-modes
Satinder Grewal 8 years ago
parent
commit
2e4888a200
  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: '15mb'})); // support json encoded bodies
guiapp.use(bodyParser.urlencoded({ extended: true, limit: '15mb' })); // support encoded bodies
guiapp.get('/', function (req, res) {
res.send('Iguana app server');

6
routes/shepherd.js

@ -150,8 +150,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',
@ -202,7 +202,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