2.0.2 • Published 8 years ago

laforge-sequelize v2.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

laforge-sequelize

Lets you do cool stuff like this:

import {route} from 'laforge'
import {CollectionRouter} from 'laforge-sequelize'

export default class ProductRouter extends CollectionRouter {

  // inherits standard REST methods

  GET / - Get all products

  POST / - Create product

  GET /:id - Get one product

  PUT /:id - Update one product

  DELETE /:id - Destroy one product

  @route('get', '/vendors', 1) // optional 3rd arg for defining route priority
  vendors() {                  // in this case needed to override GET /:id
    return this.model.findVendors()
  }

}

Instantiate like this:

import ProductRouter from './products'
import database from '../services/database' // must be Builder class from 
                                            // `sequelize-classes`

app.use('/products', (new ProductRouter({ database })).handler())

Roadmap is to include a management class for pulling a whole API together and avoid having to manually instantiate these routers.

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.15

8 years ago

0.5.14

8 years ago

0.5.13

8 years ago

0.5.12

8 years ago

0.5.11

8 years ago

0.5.10

8 years ago

0.5.9

9 years ago

0.5.8

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago