Skip to content

ElemeFE/restc

Folders and files

NameName
Last commit message
Last commit date
May 15, 2019
Nov 3, 2020
Nov 3, 2020
Nov 3, 2020
Nov 3, 2020
Nov 3, 2020
Jan 26, 2018
Nov 14, 2016
Jul 17, 2017
Nov 3, 2020
Nov 3, 2020
Nov 14, 2016
May 15, 2019
May 15, 2019
May 15, 2019
Dec 11, 2020
Nov 3, 2020

Repository files navigation

restc

CircleCI (all branches)

中文文档

Introduction

restc is an HTTP server middleware, aiming to enhance debugging experience on RESTful APIs.

It can be easily integrated with popular HTTP frameworks. You will see:

  • formatted JSON responses in the browser
  • a debug panel with which you can send GET, POST, PUT, PATCH and DELETE requests directly in the browser

You can even share a request by sharing its URL directly to others and everything will be automatically filled in the panel.

Getting Started

npm install --save restc

Use the middleware

const restc = require('restc');
// for express
app.use(restc.express());
// for koa
app.use(restc.koa());
// ...and koa2
app.use(restc.koa2());
// for hapi
server.register(restc.hapi)
// for hapi of legacy version
server.register([{
  register: restc.hapiLegacy
}], (err) => {
  if (err) {
    throw err
  }
})