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.

22 lines
559 B

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