2.0.2 • Published 9 years ago
laforge-sequelize v2.0.2
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
9 years ago
2.0.1
9 years ago
2.0.0
9 years ago
1.1.0
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago
0.6.2
9 years ago
0.6.1
9 years ago
0.6.0
9 years ago
0.5.15
9 years ago
0.5.14
9 years ago
0.5.13
9 years ago
0.5.12
9 years ago
0.5.11
9 years ago
0.5.10
9 years ago
0.5.9
10 years ago
0.5.8
10 years ago
0.5.7
10 years ago
0.5.6
10 years ago
0.5.5
10 years ago
0.5.4
10 years ago
0.5.2
10 years ago
0.5.1
10 years ago
0.5.0
10 years ago
0.4.1
10 years ago
0.4.0
10 years ago
0.3.0
10 years ago
0.2.1
10 years ago
0.2.0
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago