Skip to content

Instantly share code, notes, and snippets.

@astrotars
Created July 30, 2018 16:52
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 astrotars/5cf1d4e225ef24e72712fa9c29c9c13b to your computer and use it in GitHub Desktop.
Save astrotars/5cf1d4e225ef24e72712fa9c29c9c13b to your computer and use it in GitHub Desktop.
import Playlist from '../controllers/playlist';
import { wrapAsync } from '../utils/controllers';
module.exports = api => {
api.route('/playlists').get(wrapAsync(Playlist.list));
api.route('/playlists/:playlistId').get(wrapAsync(Playlist.get));
api.route('/playlists').post(wrapAsync(Playlist.post));
api.route('/playlists/:playlistId').put(wrapAsync(Playlist.put));
api.route('/playlists/:playlistId').delete(wrapAsync(Playlist.delete));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment