Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function printRoutes(srcPath, port) {
const patterns = methods.map(m => `**/${m}.+(json|js)`);
globby(patterns, {cwd: srcPath})
.then(paths => {
const routes = paths.map(p => {
// Remove filename from path
const directoryPath = p.substring(0, p.lastIndexOf('/'));
return `http://localhost:${port}/${directoryPath}`;
});
for (let route of new Set(routes)) {
out.info(route);
}
});
}
var compose = require('koa-compose')
var isGenFun = require('is-gen-fn')
var flatten = require('flatten')
var assert = require('assert')
var METHODS = require('methods').map(function (method) {
return method.toUpperCase()
})
var Router = require('./router')
Router.prototype.routes = function () {
var router = this
var app = this.app
// app.route(paths).get(gen).post(gen)
app.route = function () {
return new Route(router, [].slice.call(arguments))
}
// app.get(paths, gen, gen ,gen)
METHODS.forEach(function (method) {