rawmind/express-autodoc

View on GitHub
examples/withRouter/app.js

Summary

Maintainability
A
0 mins
Test Coverage
const express = require('express');
const app = express();
const songsRouter = require('./songsRouter');

/**
 * @description Get song by ID
 */
app.get('/api/v1/song/:id', (_req, res) => (
  res.json({
    title: 'abum 1',
  })
));

app.use('/songs', songsRouter); // app.use(/path/ , route)
app.use('/v2/api/songs', songsRouter)

// eslint-disable-next-line no-unused-vars
app.use(function (err, req, res, _next) {
});

// eslint-disable-next-line no-unused-vars
app.use(function (req, res, _next) {
});


module.exports = app;