# swagger-nodejs-server **Repository Path**: openks/swagger-nodejs-server ## Basic Information - **Project Name**: swagger-nodejs-server - **Description**: swagger 官方项目生成nodejs版本 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-05-09 - **Last Updated**: 2021-08-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Swagger generated server ## Overview This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. ### Running the server To run the server, run: ``` //不需要提前安装 直接启用start即可 npm start ``` To view the Swagger UI interface: ``` open http://localhost:8080/docs ``` This project leverages the mega-awesome [swagger-tools](https://github.com/apigee-127/swagger-tools) middleware which does most all the work. 默认端口号8080 如果需要修改默认端口号需同时修改 `api/swagger.yaml`和`index.js`两个文件的两个端口号 对请求`GET /pet/{petId}`的`name`属性添加mock数据(每次请求返回数据都不一样) URL请求路径如下:配置文件在`api/swagger.yaml` http://localhost:8080/v2/pet/5