From 1fac54a69a4fd21b28953f2073904cbd3aee8577 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 27 Dec 2017 12:34:43 +0100 Subject: adding shader route --- lib/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/index.js') diff --git a/lib/index.js b/lib/index.js index a53dc34..8c089f5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -66,4 +66,24 @@ site.init = function(){ } }) }) + + /* shaderblaster / asciiblaster apis */ + app.post("/cgi-bin/im/shader/upload", multer_upload.single('qqfile'), function(req, res){ + upload.put("shader", req.file, { + + unacceptable: function(err){ + res.json({ error: err }) + }, + success: function(url){ + db.createShaderImage({ + username: req.body.username, + tag: req.body.tag, + url, + }).then(function(image){ + res.json(image) + }) + } + }) + }) + } -- cgit v1.2.3-70-g09d2