Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsanchezvv/swagger-express-api-baseline
Baseline to create a swagger-node-runner project. Uses the openApi standard.
https://github.com/lsanchezvv/swagger-express-api-baseline
documentation express nodejs openapi openapi-spec swagger
Last synced: about 1 month ago
JSON representation
Baseline to create a swagger-node-runner project. Uses the openApi standard.
- Host: GitHub
- URL: https://github.com/lsanchezvv/swagger-express-api-baseline
- Owner: lsanchezvv
- Created: 2021-04-17T16:30:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-17T16:46:50.000Z (over 3 years ago)
- Last Synced: 2024-09-29T12:01:45.907Z (about 2 months ago)
- Topics: documentation, express, nodejs, openapi, openapi-spec, swagger
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# swagger-express-api-baseline
Want to write your endpoint and the documentation for it at the same time? You can try swagger-node-runner.
This project creates a simple swagger express API endpoint baseline using nodejs.The main goal of this project is to quickly spin up a project that allows you to define api's using the OpenApi Specification.
# Running locally
1. Run `npm install`
2. Run `npm start`Visit http://localhost:10014/api-docs to see the documentation. Note: If no PORT is defined on the .env file, the default port is assigned: 10014.
To test visit http://localhost:10014/v1/hello using your browser or postman.
# Defining new endpoints
To define new endpoints, create a new path in the ~/swagger/swagger.yaml file.
You can assign a new controller or use the existing one.The `x-swagger-router-controller` property needs to have the same name as the new controller filename.
The `operationId` is the exported name function for the controller.
The `basePath` property is optional, in case you need your endpoint to have a base path.Visit https://swagger.io/specification/v2/ for more information on how to use the open API specification.
# Published using heroku
To call the endpoint example visit: https://swagger-express-api-baseline.herokuapp.com/v1/helloTo see the api documentation: https://swagger-express-api-baseline.herokuapp.com/v1/hello