summaryrefslogtreecommitdiff
path: root/lib/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-27 12:34:43 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-27 12:34:43 +0100
commit1fac54a69a4fd21b28953f2073904cbd3aee8577 (patch)
treedbdec9e6a436944524336252146cfbac191f3cd0 /lib/index.js
parentc8752ee2552a96df1cc235107a3674602c2220bb (diff)
adding shader route
Diffstat (limited to 'lib/index.js')
-rw-r--r--lib/index.js20
1 files changed, 20 insertions, 0 deletions
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)
+ })
+ }
+ })
+ })
+
}