X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fapi%2Fsound%2Findex.js;h=649eb58e403e6a687bc2ef107fda689729af0ad8;hb=913cc995a38cf7bfbc27d325e09fc2b6ae2f632d;hp=51659328e8c736416fc57cadcdd964dddaee29f9;hpb=da8b5d32823ad8783d3c47a738f61aa66e32f99c;p=motion2.git diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5165932..649eb58 100644 --- a/server/api/sound/index.js +++ b/server/api/sound/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x314c=['basename','extname','now','post','single','file','create','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0xcbd84c,_0x205c58){var _0x2ce1c2=function(_0x4e3d98){while(--_0x4e3d98){_0xcbd84c['push'](_0xcbd84c['shift']());}};_0x2ce1c2(++_0x205c58);}(_0x314c,0x175));var _0xc314=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x314c[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xc314('0x0'));var util=require('util');var path=require(_0xc314('0x1'));var timeout=require(_0xc314('0x2'));var express=require(_0xc314('0x3'));var router=express[_0xc314('0x4')]();var auth=require(_0xc314('0x5'));var interaction=require(_0xc314('0x6'));var config=require(_0xc314('0x7'));var controller=require('./sound.controller');router['get']('/',auth[_0xc314('0x8')](),controller[_0xc314('0x9')]);router[_0xc314('0xa')](_0xc314('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xc314('0xc'),auth[_0xc314('0x8')](),controller[_0xc314('0xd')]);var upload=multer({'storage':multer[_0xc314('0xe')]({'destination':function(_0x49d4cc,_0x62ea3b,_0x52bdfc){_0x52bdfc(null,path[_0xc314('0xf')](config[_0xc314('0x10')],_0xc314('0x11')));},'filename':function(_0x532361,_0x1414b3,_0x25f2ec){_0x1414b3[_0xc314('0x12')]=_0x1414b3[_0xc314('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25f2ec(null,util['format']('%s-%s%s',path[_0xc314('0x13')](_0x1414b3[_0xc314('0x12')],path[_0xc314('0x14')](_0x1414b3[_0xc314('0x12')])),Date[_0xc314('0x15')](),path['extname'](_0x1414b3[_0xc314('0x12')])));}})});router[_0xc314('0x16')]('/',upload[_0xc314('0x17')](_0xc314('0x18')),controller[_0xc314('0x19')]);router['put'](_0xc314('0xb'),auth['isAuthenticated'](),controller[_0xc314('0x1a')]);router[_0xc314('0x1b')](_0xc314('0xb'),auth['isAuthenticated'](),controller[_0xc314('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x858c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','diskStorage','join','root','originalname','replace','%s-%s%s','basename','extname','post','single','put','/:id','delete','exports','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x858c,0x17f));var _0xc858=function(_0x52e08b,_0x13854c){_0x52e08b=_0x52e08b-0x0;var _0x28266a=_0x858c[_0x52e08b];return _0x28266a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc858('0x0'));var timeout=require(_0xc858('0x1'));var express=require(_0xc858('0x2'));var router=express[_0xc858('0x3')]();var auth=require(_0xc858('0x4'));var interaction=require(_0xc858('0x5'));var config=require(_0xc858('0x6'));var controller=require(_0xc858('0x7'));router[_0xc858('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xc858('0x9')](),controller['show']);router[_0xc858('0x8')]('/:id/download',auth[_0xc858('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xc858('0xa')]({'destination':function(_0x35d784,_0x573643,_0x198d34){_0x198d34(null,path[_0xc858('0xb')](config[_0xc858('0xc')],'server/files/sounds/original/'));},'filename':function(_0x4f7034,_0x4cc48c,_0x349dc2){_0x4cc48c[_0xc858('0xd')]=_0x4cc48c['originalname'][_0xc858('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x349dc2(null,util['format'](_0xc858('0xf'),path[_0xc858('0x10')](_0x4cc48c[_0xc858('0xd')],path[_0xc858('0x11')](_0x4cc48c[_0xc858('0xd')])),Date['now'](),path['extname'](_0x4cc48c[_0xc858('0xd')])));}})});router[_0xc858('0x12')]('/',upload[_0xc858('0x13')]('file'),controller['create']);router[_0xc858('0x14')](_0xc858('0x15'),auth[_0xc858('0x9')](),controller['update']);router[_0xc858('0x16')](_0xc858('0x15'),auth[_0xc858('0x9')](),controller[_0xc858('0x16')]);module[_0xc858('0x17')]=router; \ No newline at end of file