Created
May 1, 2017 10:38
-
-
Save gorkamu/dbfded7abc9d3066d65929bf880a9e85 to your computer and use it in GitHub Desktop.
Example of routes file in Node.js
This file contains hidden or 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
'use strict' | |
var express = require('express'); | |
var AlbumController = require('../controllers/album'); | |
var api = express.Router(); | |
api.get('/album/:id', AlbumController.getAlbum); | |
api.get('/album', AlbumController.getAlbums); | |
api.post('/album', AlbumController.saveAlbum); | |
api.put('/album', AlbumController.updateAlbum); | |
api.delete('/album/:id', AlbumController.deleteAlbum); | |
module.exports = api; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment