update nodejs express server samples

This commit is contained in:
William Cheng 2025-02-22 23:15:00 +08:00
parent f83b049fe6
commit cea3c5ba09
6 changed files with 50 additions and 25 deletions

View File

@ -1,7 +1,7 @@
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": "airbnb",
"extends": "airbnb-base",
"rules": {
"no-console": "off"
}

View File

@ -0,0 +1,19 @@
.eslintrc.json
README.md
api/openapi.yaml
config.js
controllers/Controller.js
controllers/PetController.js
controllers/StoreController.js
controllers/UserController.js
controllers/index.js
expressServer.js
index.js
logger.js
package.json
services/PetService.js
services/Service.js
services/StoreService.js
services/UserService.js
services/index.js
utils/openapiRouter.js

View File

@ -1 +1 @@
5.0.0-SNAPSHOT
7.12.0-SNAPSHOT

View File

@ -1,7 +1,7 @@
openapi: 3.0.1
info:
description: This is a sample server Petstore server. For this sample, you can use
the api key `special-key` to test the authorization filters.
description: "This is a sample server Petstore server. For this sample, you can\
\ use the api key `special-key` to test the authorization filters."
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
@ -122,8 +122,8 @@ paths:
/pet/findByTags:
get:
deprecated: true
description: Multiple tags can be provided with comma separated strings. Use
tag1, tag2, tag3 for testing.
description: "Multiple tags can be provided with comma separated strings. Use\
\ tag1, tag2, tag3 for testing."
operationId: findPetsByTags
parameters:
- description: Tags to filter by
@ -235,13 +235,7 @@ paths:
content:
application/x-www-form-urlencoded:
schema:
properties:
name:
description: Updated name of the pet
type: string
status:
description: Updated status of the pet
type: string
$ref: '#/components/schemas/updatePetWithForm_request'
responses:
"405":
content: {}
@ -269,14 +263,7 @@ paths:
content:
multipart/form-data:
schema:
properties:
additionalMetadata:
description: Additional data to pass to server
type: string
file:
description: file to upload
format: binary
type: string
$ref: '#/components/schemas/uploadFile_request'
responses:
"200":
content:
@ -767,6 +754,25 @@ components:
type: string
title: An uploaded response
type: object
updatePetWithForm_request:
properties:
name:
description: Updated name of the pet
type: string
status:
description: Updated status of the pet
type: string
type: object
uploadFile_request:
properties:
additionalMetadata:
description: Additional data to pass to server
type: string
file:
description: file to upload
format: binary
type: string
type: object
securitySchemes:
petstore_auth:
flows:
@ -780,3 +786,4 @@ components:
in: header
name: api_key
type: apiKey
x-original-swagger-version: "2.0"

View File

@ -2,9 +2,9 @@ const path = require('path');
const config = {
ROOT_DIR: __dirname,
URL_PORT: 3000,
URL_PATH: 'http://localhost',
BASE_VERSION: 'v2',
URL_PORT: 8080,
URL_PATH: 'http://petstore.swagger.io',
BASE_VERSION: '/v2',
CONTROLLER_DIRECTORY: path.join(__dirname, 'controllers'),
PROJECT_DIR: __dirname,
};

View File

@ -27,7 +27,6 @@
"winston": "^3.2.1"
},
"devDependencies": {
"axios": "^0.19.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"eslint": "^5.16.0",