-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applications controller and routes blueprint
- Loading branch information
1 parent
94677d7
commit 40e8609
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const Controller = require('./controller') | ||
|
||
class ApplicationController extends Controller { | ||
/** | ||
* Show all the applications. (15 per page) | ||
* @param {import('express').Request} req | ||
* @param {import('express').Response} res | ||
*/ | ||
index(req, res) {} | ||
|
||
/** | ||
* Show an application with a given ID | ||
* @param {import('express').Request} req | ||
* @param {import('express').Response} res | ||
*/ | ||
show(req, res) {} | ||
|
||
/** | ||
* Update information about a particular event | ||
* @param {import('express').Request} req | ||
* @param {import('express').Response} res | ||
*/ | ||
update(req, res) {} | ||
|
||
/** | ||
* Delete an application from the database | ||
* @param {import('express').Request} req | ||
* @param {import('express').Response} res | ||
*/ | ||
delete(req, res) {} | ||
} | ||
|
||
module.exports = new ApplicationController() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const router = require('express').Router() | ||
|
||
/** | ||
* Load all the applications from the database. | ||
* The default result count is 15 per page | ||
*/ | ||
router.get('/', (req, res) => {}) | ||
|
||
/** | ||
* Create a new application and return it with | ||
* a 201 response | ||
*/ | ||
router.post('/', (req, res) => {}) | ||
|
||
/** | ||
* Get a application using it's database ID | ||
* A 404 response is returned if the application was | ||
* Not found in the database | ||
*/ | ||
router.get('/:id', (req, res) => {}) | ||
|
||
/** | ||
* Update an application's information. | ||
* Returns 201 on success | ||
*/ | ||
router.put('/:id', (req, res) => {}) | ||
|
||
/** | ||
* Deletes an application from the database | ||
* A 200 response is returned on success | ||
*/ | ||
router.delete('/', (req, res) => {}) | ||
|
||
module.exports = router |