MusicTopus/src/routes/collection.js
Damien Broqua aeb5df067c issue/1 (#31)
Co-authored-by: dbroqua <contact@darkou.fr>
Reviewed-on: #31
2022-03-06 14:38:26 +01:00

22 lines
448 B
JavaScript

import express from "express";
import Albums from "../middleware/Albums";
import render from "../libs/format";
// eslint-disable-next-line new-cap
const router = express.Router();
router.route("/:userId").get(async (req, res, next) => {
try {
const page = new Albums(req, "collection");
await page.loadPublicCollection();
render(res, page);
} catch (err) {
next(err);
}
});
export default router;