|
|
@@ -1,5 +1,7 @@
|
|
|
module.exports = function(crowi, app) {
|
|
|
var middleware = require('../util/middlewares')
|
|
|
+ , multer = require('multer')
|
|
|
+ , uploads = multer({dest: crowi.tmpDir + 'uploads'})
|
|
|
, form = require('../form')
|
|
|
, page = require('./page')(crowi, app)
|
|
|
, login = require('./login')(crowi, app)
|
|
|
@@ -85,7 +87,7 @@ module.exports = function(crowi, app) {
|
|
|
app.get( '/_api/search' , accessTokenParser , loginRequired(crowi, app) , search.api.search);
|
|
|
|
|
|
app.get( '/_api/check_username' , user.api.checkUsername);
|
|
|
- app.post('/_api/me/picture/upload' , loginRequired(crowi, app) , me.api.uploadPicture);
|
|
|
+ app.post('/_api/me/picture/upload' , loginRequired(crowi, app) , uploads.single('userPicture'), me.api.uploadPicture);
|
|
|
app.get( '/_api/user/bookmarks' , loginRequired(crowi, app) , user.api.bookmarks);
|
|
|
|
|
|
app.get( '/user/:username([^/]+)/bookmarks' , loginRequired(crowi, app) , page.userBookmarkList);
|
|
|
@@ -109,7 +111,7 @@ module.exports = function(crowi, app) {
|
|
|
app.post('/_api/likes.add' , accessTokenParser , loginRequired(crowi, app) , csrf, page.api.like);
|
|
|
app.post('/_api/likes.remove' , accessTokenParser , loginRequired(crowi, app) , csrf, page.api.unlike);
|
|
|
app.get( '/_api/attachments.list' , accessTokenParser , loginRequired(crowi, app) , attachment.api.list);
|
|
|
- app.post('/_api/attachments.add' , accessTokenParser , loginRequired(crowi, app) , csrf, attachment.api.add);
|
|
|
+ app.post('/_api/attachments.add' , accessTokenParser , loginRequired(crowi, app) , uploads.single('file'), csrf, attachment.api.add);
|
|
|
app.post('/_api/attachments.remove' , accessTokenParser , loginRequired(crowi, app) , csrf, attachment.api.remove);
|
|
|
|
|
|
app.get( '/_api/revisions.get' , accessTokenParser , loginRequired(crowi, app) , revision.api.get);
|