Wtower / generator-makrina

Yeoman generator for MEAN projects
MIT License
5 stars 0 forks source link

Change REST API endpoints #11

Closed Wtower closed 8 years ago

Wtower commented 8 years ago

CRUD

Additionally:

Wtower commented 8 years ago

Route https://github.com/Wtower/generator-makrina/blob/v0.3.0/generators/model/templates/routes/api/_object-name_s.js.ejs#L21

router.get('/:<%= objectName %>Id', function(req, res, next) {
  if (!req.session.login) return res.redirect('/admin/login');
  if (req.params.<%= objectName %>Id) {
Wtower commented 8 years ago

The current endpoints follow the Angular $resource recommendations.

https://docs.angularjs.org/api/ngResource/service/$resource