Created
February 28, 2022 06:51
-
-
Save kenu/606176842b456fd35875e368b3eebb09 to your computer and use it in GitHub Desktop.
jsdoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const router = express.Router(); | |
/** | |
* @openapi | |
* /api/hello: | |
* get: | |
* description: Welcome to swagger-jsdoc! | |
* parameters: | |
* - name: name | |
* in: query | |
* required: false | |
* schema: | |
* type: string | |
* responses: | |
* 200: | |
* description: Returns a mysterious string. | |
*/ | |
router.get('/hello', function (req, res, next) { | |
const name = req.query.name || 'World'; | |
res.json({ message: `Hello ${name}` }); | |
}); | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment