From: dsc Date: Thu, 29 Mar 2012 13:27:52 +0000 (-0700) Subject: Fixes graph saving. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=49bcc7e999a2657e92e207292ca0e1624b9bddc7;p=limn.git Fixes graph saving. --- diff --git a/lib/server/server.co b/lib/server/server.co index a791145..cec9568 100755 --- a/lib/server/server.co +++ b/lib/server/server.co @@ -131,7 +131,7 @@ app.configure -> app.get '/', (req, res) -> res.render 'dashboard' -app.post '/graph/save', (req, res, next) -> +saveGraph = (req, res, next) -> if not req.body return res.send {result:"error", message:"JSON required!"}, 501 @@ -150,6 +150,9 @@ app.post '/graph/save', (req, res, next) -> res.send { result:"ok" } +app.post '/graph/save', saveGraph +app.put '/graph/:slug\.json', saveGraph + app.get '/graph/:slug\.json', (req, res, next) -> req.url .= replace /^\/graph\//i, '/presets/' next()