23 lines
448 B
JavaScript
23 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;
|