# express-test **Repository Path**: izhuooo/express-test ## Basic Information - **Project Name**: express-test - **Description**: test express mysql and ejs - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## test express mysql and ejs ### 全局依赖 1. pm2 ### 依赖 1. express-swagger-generator https://www.npmjs.com/package/express-swagger-generator 2. express-swaggerize-ui https://github.com/pgroot/express-swaggerize-ui 3. 教程 https://blog.csdn.net/iorn_mangg/article/details/106799901 ### 使用 ~~~js /** * This function comment is parsed by doctrine * @summary api描述 * @route GET /api * @group foo - Operations about user * @param {string} email.query.required - username or email - eg: user@domain * @param {string} password.query.required - user's password. * @returns {object} 200 - An array of user info * @returns {Error} default - Unexpected error */ exports.foo = function() {} ~~~ # Swagger This is a sample server ``https://swagger-markdown-ui.netlify.app/`` ## Version: 1.0.0 ### /get #### GET ##### 描述: This function comment is parsed by doctrine ##### 请求参数: | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ---- | ##### 响应状态: | Code | Description | | ---- | ----------- | | 200 | An array of user info | | default | Unexpected error | ##### 安全验证: | Security Schema | Scopes | | --- | --- | | JWT | | ### /post #### POST ##### 描述: This function comment is parsed by doctrine ##### 请求参数: | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ---- | | file | body | eg: user@domain | No | object | | point | body | the new point | Yes | [Point](#Point) | | email | query | username or email - eg: user@domain | Yes | string | | password | query | user's password. | Yes | string | ##### 响应状态: | Code | Description | | ---- | ----------- | | 200 | An array of user info | | default | Unexpected error | ### /name #### GET ##### 描述: 根据密码查询用户 ##### 请求参数: | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ---- | | password | query | 用户's password. | Yes | string | ##### 响应状态: | Code | Description | | ---- | ----------- | | 200 | An array of user info | | default | Unexpected error | ### /names #### POST ##### 概要: POST方法 ##### 描述: This function comment is parsed by doctrine ##### 请求参数: | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ---- | | user | body | username or email | Yes | [ReqNameJSON](#ReqNameJSON) | | password | query | user's password. | Yes | string | ##### 响应状态: | Code | Description | | ---- | ----------- | | 200 | An array of user info | | default | Unexpected error | ### /file/:name #### POST ##### 概要: 发送文件 ##### 描述: This function comment is parsed by doctrine ##### 请求参数: | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ---- | | name | params | params.name. | Yes | string | ##### 响应状态: | Code | Description | | ---- | ----------- | | 200 | An array of user info | | default | Unexpected error | ##### 安全验证: | Security Schema | Scopes | | --- | --- | | JWT | | ### Models #### ReqNameJSON | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | username | string | name of person making request | No | | password | string | password of person making request | No |