Skip to content

Instantly share code, notes, and snippets.

@gorkamu
Created May 1, 2017 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gorkamu/dbfded7abc9d3066d65929bf880a9e85 to your computer and use it in GitHub Desktop.
Save gorkamu/dbfded7abc9d3066d65929bf880a9e85 to your computer and use it in GitHub Desktop.
Example of routes file in Node.js
'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