Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dpecos/rest-swagger-example

Example of a Swagger REST API in Node.js
https://github.com/dpecos/rest-swagger-example

express nodejs rest swagger

Last synced: 8 days ago
JSON representation

Example of a Swagger REST API in Node.js

Awesome Lists containing this project

README

        

About
=====

Project showing how to setup Swagger for a REST API develop with Node.js and Express.

More details in the blog entry: https://danielpecos.com/2017/09/06/rest-api-with-node-js-and-swagger

Installation
============

npm install
npm start

Swagger documentation - HTML and JSON
===================================

* Swagger UI:


http://localhost:3000/api/docs

* JSON:

http://localhost:3000/api/docs/json

REST API Endpoints
==================

* *GET* http://localhost:3000/api/stocks
* *GET* http://localhost:3000/api/stocks/1
* *POST* http://localhost:3000/api/stocks
* *PUT* http://localhost:3000/api/stocks/1