The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
579 B

  1. const express = require("express")
  2. const router = express.Router()
  3. const common = require("./common")
  4. const {storyApi} = require("../../rpdata/api/Story")
  5. const listTemplate = require("../../marko/page/story/list.marko")
  6. router.get("/:author", common, async(req, res) => {
  7. res.locals.menuAuthor = req.params.author
  8. try {
  9. res.markoAsync(listTemplate, {
  10. stories: storyApi.list({author: req.params.author}),
  11. menuAuthor: req.params.author,
  12. selected: {special: "author"},
  13. })
  14. } catch(err) {
  15. console.error(err)
  16. }
  17. })
  18. module.exports = router