项目作者: iandrosov

项目描述 :
Heroku Example for WEB_CONCURRENCY with Node and Swagger
高级语言: JavaScript
项目地址: git://github.com/iandrosov/node-swagger-concurrency.git
创建时间: 2019-10-23T05:16:46Z
项目社区:https://github.com/iandrosov/node-swagger-concurrency

开源协议:Apache License 2.0

下载


node-swagger-concurrency

Heroku Example for WEB_CONCURRENCY with Node and Swagger. This example demonstrates how to apply Concurrency to Node.js server applications created with Swagger as part of Heroku Twelve-Factor App methodology.

Overview

This server was generated by the swagger-codegen project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub. This is an example of building a node.js server.

This example uses the expressjs framework. To see how to make this your own, look here:

README

Running the server

To build & run the server as default 1 process, run:

  1. npm start

To build & run the server with 4 concurrent processes, rin:

  1. WEB_CONCURRENCY=4 npm start

The build process fetches all required dependencies to run this server. This is needed for deployment to Heroku platform, for Node buildpack to assemble this app.

To run the server, run:

  1. WEB_CONCURRENCY=4 node index.js

To view the Swagger UI interface API docs:

  1. open http://localhost:8080/docs

This project leverages the mega-awesome swagger-tools middleware which does most all the work.