open-music-api-node
Version:
30 lines (28 loc) • 521 B
JavaScript
const routes = (handler) => [
{
method: 'POST',
path: '/songs',
handler: handler.addSongHandler,
},
{
method: 'GET',
path: '/songs',
handler: handler.getSongHandler,
},
{
method: 'GET',
path: '/songs/{id}',
handler: handler.getSongByIdHandler,
},
{
method: 'PUT',
path: '/songs/{id}',
handler: handler.updateSongByIdHandler,
},
{
method: 'DELETE',
path: '/songs/{id}',
handler: handler.deleteSongByIdHandler,
},
];
module.exports = routes;