1.3.1 • Published 8 years ago

restify-resourcify v1.3.1

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

restify-resourcify

Declarative bindings to restify service endpoint registration.

npm version Dependency Status Build Status

Getting Started

npm install restify-resourcify

Note: You need to have restify installed. Take a look at the peerDependencies in package.json for version compatibility.

Usage

import {Resource, path, GET} from 'restify-resourcify';

@path('/users/')
class UserResource extends Resource {

  @GET
  async fetchUsers(request) {
    return {
      data: await db.loadUsers
    };
  }

  @GET
  @path(':id')
  async fetchUser(request) {
    return {
      data: await db.loadUser({
        id: request.params.id
      })
    };
  }

}
1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

0.0.1

8 years ago