mirror of
https://github.com/Febbweiss/CloudBudget.git
synced 2026-03-04 22:35:38 +00:00
Feature: First version of the REST API done
This commit is contained in:
22
app/routes/accounts.js
Normal file
22
app/routes/accounts.js
Normal file
@@ -0,0 +1,22 @@
|
||||
var passport = require('../security/passport'),
|
||||
AccountController = require('../controllers/accounts');
|
||||
|
||||
module.exports = function(app) {
|
||||
|
||||
app.post('/api/accounts', passport.jwt, AccountController.create);
|
||||
|
||||
app.delete('/api/accounts/:account_id', passport.jwt, AccountController.delete);
|
||||
|
||||
app.get('/api/accounts/:account_id', passport.jwt, AccountController.get);
|
||||
|
||||
app.put('/api/accounts/:account_id', passport.jwt, AccountController.modify);
|
||||
|
||||
app.post('/api/accounts/:account_id/entries', passport.jwt, AccountController.add_entry);
|
||||
|
||||
app.put('/api/accounts/:account_id/entries/:entry_id', passport.jwt, AccountController.modify_entry);
|
||||
|
||||
app.delete('/api/accounts/:account_id/entries/:entry_id', passport.jwt, AccountController.delete_entry);
|
||||
|
||||
app.get('/api/accounts/:account_id/entries', passport.jwt, AccountController.list_entries);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user