DocSpace-client/common/ASC.Socket.IO/app/controllers/index.js

22 lines
521 B
JavaScript
Raw Normal View History

module.exports = (files) => {
const router = require("express").Router(),
bodyParser = require("body-parser"),
authService = require("../middleware/authService.js")();
2020-08-02 20:12:45 +00:00
router.use(bodyParser.json());
router.use(bodyParser.urlencoded({ extended: false }));
router.use(require("cookie-parser")());
router.use((req, res, next) => {
if (!authService(req)) {
res.sendStatus(403);
return;
}
2020-08-02 20:12:45 +00:00
next();
});
2020-08-02 20:12:45 +00:00
router.use("/files", require(`./files.js`)(files));
return router;
};