Skip to content

Commit

Permalink
standardise status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Tokumine committed Nov 21, 2011
1 parent 8285bb6 commit 4c697d5
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion lib/windshaft/server.js
Expand Up @@ -93,7 +93,7 @@ module.exports = function(opts){
},
function(err, data){
if (err){
res.send(err.message.split('\n'), 400);
res.send(err.message.split('\n'), 500);
} else {
render_cache.reset(req);
res.send(200);
Expand All @@ -102,6 +102,41 @@ module.exports = function(opts){
);
});


// Delete Map Style
app.post(app.base_url + '/delete_style', function(req, res){
var mml_builder;

Step(
function(){
app.req2params(req, this);
},
function(err, data){
if (err) throw err;
if (_.isUndefined(req.body) || _.isUndefined(req.body.style)) {
res.send({error: 'must send style information'}, 400);
} else {
mml_builder = mml_store.mml_builder(req.params);
mml_builder.setStyle(req.body.style, this);
}
},
function(err, data) {
if (err) throw err;
var param = req.params;
app.afterStateChange(req, data, this);
},
function(err, data){
if (err){
res.send(err.message.split('\n'), 500);
} else {
render_cache.reset(req);
res.send(200);
}
}
);
});


// Tile render.
// query string args are:
// `sql`
Expand Down

0 comments on commit 4c697d5

Please sign in to comment.