Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

luckycadow/hapi-sequelize-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hapi-sequelize-rest

RESTful Hapi routes based on sequelize models

Install

$ npm install hapi-sequelize-rest

Usage

Register your sequelize models with hapi-sequelize and then register hapi-sequelize-rest.

For example, in a manifest:

{
    plugin: {
        register: './models',
        options: {
            uri: Config.get('/database/uri')
        }
    }
},
{
    plugin: {
        register: 'hapi-sequelize-rest',
        options: {
            prefix: '/api/v1',
            readOnly: false
        }
    }
}

Options

  • prefix: You can provide a prefix for your api routes. By default api routes will be registered against the root of your site.

  • readOnly: Set this to a truthy value and hapi-sequelize-rest will only register routes for GET-ing resources.

TODO

  1. Provide an option for authentication.
  2. Add some tests.

License

MIT

About

RESTful hapi endpoints based on sequelize models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published