1.0.15 • Published 29 days ago

w-restapi v1.0.15

Weekly downloads
2
License
MIT
Repository
github
Last release
29 days ago

w-restapi

A REST API server with swagger.

language npm version license gzip file size npm download npm download jsdelivr download

Documentation

To view documentation or get support, visit docs.

Installation

Using npm(ES6 module):

Note: w-restapi is mainly dependent on @hapi/hapi and @hapi/inert.

npm i w-restapi

Example for w-restapi:

Link: [dev source code]

import WRestapi from 'w-restapi'

let routes = { apiName: 'store', props: { 'id': { 'type': 'string', 'description': 'id description', }, 'prodcname': { 'type': 'string', 'description': 'prodcname description', }, 'price': { 'type': 'number', 'description': 'price description', } }, }, { apiName: 'pet', props: { 'id': { 'type': 'string', 'description': 'id description', }, 'petname': { 'type': 'string', 'description': 'petname description', }, 'belognname': { 'type': 'string', 'description': 'belognname description', } }, },

function proc({ method, apiName, propName, propValue, payload, pm, req, res }) { //可由req內資訊做身份驗證

//resolve
pm.resolve(JSON.stringify({ method, apiName, propName, propValue, payload }))
console.log(method, apiName, propName, propValue, payload)

}

new WRestapi({ routes, proc })

//view swagger: http://localhost:8080/swdoc/index.html

1.0.15

29 days ago

1.0.14

1 month ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

3 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago