index.js 452 B

1234567891011121314151617181920
  1. // 添加账本
  2. import express from "express";
  3. const router = express.Router();
  4. // middleware that is specific to this router
  5. router.use(function timeLog(req, res, next) {
  6. console.log("Time: ", Date.now());
  7. next();
  8. });
  9. // define the home page route
  10. router.get("/", function (req, res) {
  11. res.send("Books home page");
  12. });
  13. // define the about route
  14. router.get("/about", function (req, res) {
  15. res.send("About books");
  16. });
  17. export default router;