0.0.4 • Published 7 years ago

restr v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

restr is a small application which makes it super-easy to define your own restfull services. API endpoints are defined in a language-neutral JSON format, and the implementation is as simple as exporting a set of functions.

:warning: restr is still in development. New features will be added in upcoming releases.

Install globally with:

npm i -g restr

Roadmap

The following features will be added in an upcoming release:

  • Watching for changes
  • Auto-validation before dispatching to controller

See the first milestone for details.

QuickStart

Let's create a mock service which tells the consumer that his user was successfully created:

api.json

{
  "name": "my-service",
  "version": "1",
  "endpoints": {
    "POST /users": "createNewUser",
    "GET /user/:name": "fetchUserInfo"
  }
}

controllers.js

export function createNewUser(params) {
  return { created: true }
}

Next, let's run our service.

$ restr

restr will automatically notify when a certain controller was not found.

See the examples/ directory for a full setup.

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago