api definition created
This commit is contained in:
		
							
								
								
									
										53
									
								
								oas.yml
									
									
									
									
									
								
							
							
						
						
									
										53
									
								
								oas.yml
									
									
									
									
									
								
							@@ -1,53 +0,0 @@
 | 
				
			|||||||
openapi: 3.0.2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
info:
 | 
					 | 
				
			||||||
  title: Digital fingerprint of plastics - API
 | 
					 | 
				
			||||||
  version: 1.0.0
 | 
					 | 
				
			||||||
  description: Gives access to the project database
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
servers:
 | 
					 | 
				
			||||||
  - url: http://localhost:3000
 | 
					 | 
				
			||||||
    description: local server
 | 
					 | 
				
			||||||
  - url: https://digital-fingerprint-of-plastics-api.apps.de1.bosch-iot-cloud.com/
 | 
					 | 
				
			||||||
    description: server on the BIC
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
tags:
 | 
					 | 
				
			||||||
  - name: /
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
paths:
 | 
					 | 
				
			||||||
  /:
 | 
					 | 
				
			||||||
    get:
 | 
					 | 
				
			||||||
      summary: Root method
 | 
					 | 
				
			||||||
      tags:
 | 
					 | 
				
			||||||
        - /
 | 
					 | 
				
			||||||
      responses:
 | 
					 | 
				
			||||||
        200:
 | 
					 | 
				
			||||||
          description: Server is working
 | 
					 | 
				
			||||||
          content:
 | 
					 | 
				
			||||||
            application/json:
 | 
					 | 
				
			||||||
              schema:
 | 
					 | 
				
			||||||
                properties:
 | 
					 | 
				
			||||||
                  message:
 | 
					 | 
				
			||||||
                    type: string
 | 
					 | 
				
			||||||
                    example: 'API server up and running!'
 | 
					 | 
				
			||||||
        500:
 | 
					 | 
				
			||||||
          $ref: '#/components/responses/500'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
components:
 | 
					 | 
				
			||||||
  responses:
 | 
					 | 
				
			||||||
    500:
 | 
					 | 
				
			||||||
      description: Internal server error
 | 
					 | 
				
			||||||
      content:
 | 
					 | 
				
			||||||
        application/json:
 | 
					 | 
				
			||||||
          schema:
 | 
					 | 
				
			||||||
            properties:
 | 
					 | 
				
			||||||
              message:
 | 
					 | 
				
			||||||
                type: string
 | 
					 | 
				
			||||||
                example: 'Internal server error'
 | 
					 | 
				
			||||||
              error:
 | 
					 | 
				
			||||||
                type: boolean
 | 
					 | 
				
			||||||
                example: true
 | 
					 | 
				
			||||||
@@ -6,7 +6,7 @@
 | 
				
			|||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "test": "mocha dist/**/**.spec.js",
 | 
					    "test": "mocha dist/**/**.spec.js",
 | 
				
			||||||
    "start": "tsc && node dist/index.js",
 | 
					    "start": "tsc && node dist/index.js",
 | 
				
			||||||
    "dev": "nodemon -e ts --exec \"npm run start\""
 | 
					    "dev": "nodemon -e ts,yaml --exec \"npm run start\""
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "keywords": [],
 | 
					  "keywords": [],
 | 
				
			||||||
  "author": "",
 | 
					  "author": "",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,7 +44,7 @@ app.use('/', require('./routes/root'));
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Swagger UI
 | 
					// Swagger UI
 | 
				
			||||||
app.use('/api', swagger.serve, swagger.setup(
 | 
					app.use('/api', swagger.serve, swagger.setup(
 | 
				
			||||||
  yaml.load('./oas.yml'),
 | 
					  yaml.load('./oas.yaml'),
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    defaultModelsExpandDepth: -1,
 | 
					    defaultModelsExpandDepth: -1,
 | 
				
			||||||
    customCss: '.swagger-ui .topbar { display: none }'
 | 
					    customCss: '.swagger-ui .topbar { display: none }'
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user