Skip to content

leoselig/restify-resourcify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
      })
    };
  }

}

About

Declarative bindings to restify service endpoint registration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published