1.3.1 • Published 9 years ago

restify-resourcify v1.3.1

Weekly downloads
4
License
MIT
Repository
github
Last release
9 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

9 years ago

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

0.0.1

10 years ago