How to use express-list-endpoints - 5 common examples

To help you get started, we’ve selected a few express-list-endpoints examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WalletConnect / node-walletconnect-bridge / src / index.js View on Github external
// cors
app.use(function(req, res, next) {
  res.header('Access-Control-Allow-Origin', '*')
  res.header(
    'Access-Control-Allow-Headers',
    'Origin, X-Requested-With, Content-Type, Accept'
  )
  next()
})

// Import API Routes
app.use('/', router)

// print all routes
expressListRoutes(router).forEach(p => {
  console.log(p.methods.join(','), p.path)
})

// Listen the server
app.listen(port)

// log server start event
console.log(`Server listening on ${host}:${port}`) // eslint-disable-line no-console
github guardian / editions / projects / backend / application.ts View on Github external
}),
        controllers.imageController,
    )

    app.get(
        '/' +
            thumbsPath(
                issuePathSegments,
                ':size' as ImageSize,
                { source: ':source', path: '*?' },
                ':use' as ImageThumbnailUse,
            ),
        controllers.imageController,
    )

    const endpoints = listEndpoints(app)

    const rootPath = '/'

    app.get(rootPath, (req, res) => {
        res.setHeader('Content-Type', 'application/json')
        res.send(endpoints)
    })
    return app
}
github mathieutu / vue-cli-plugin-express / src / server.js View on Github external
function getAppEndpoints (app) {
  try {
    return listEndpoints(app);
  } catch (e) {
    return [];
  }
}
github rlindskog / vueniverse / demo / src / server / api / index.js View on Github external
router.get('/', (req, res) => {
  res.json(listEndpoints(router))
})
github rlindskog / vueniverse / template / src / server / api / index.js View on Github external
router.get('/', (req, res) => {
  res.json(listEndpoints(router))
})

express-list-endpoints

A express package to list all registered endpoints and its verbs

MIT
Latest version published 1 month ago

Package Health Score

75 / 100
Full package analysis

Popular express-list-endpoints functions