📜  用于快速路由的 jsdoc - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:36.884000             🧑  作者: Mango

代码示例1
/** Express router providing user related routes
 * @module routers/users
 * @requires express
 */

/**
 * express module
 * @const
 */
const express = require('express');

/**
 * Express router to mount user related functions on.
 * @type {object}
 * @const
 * @namespace usersRouter
 */
const router = express.Router();

/**
 * Route serving login form.
 * @name get/login
 * @function
 * @memberof module:routers/users~usersRouter
 * @inner
 * @param {string} path - Express path
 * @param {callback} middleware - Express middleware.
 */
router.get('/login', function(req, res, next) {
  res.render('login', {title: 'Login', message: 'You must login'});
});