function resolveView(req, res, next) {
	var urlPath = req.path ? path.basename(req.path, path.extname(req.path)) : 'index';

	function hasRoute(urlPath) {
		return routes.hasOwnProperty(urlPath);
	}

	if (hasRoute(urlPath)) {
		render(res, urlPath);
	} else {
		// Regenerate routes if route was not found, in case view file was created after nitro was started.
		createRoutes();
		if (hasRoute(urlPath)) {
			render(res, urlPath);
		} else {
			next();
		}
	}
}
/**
 * Find view template based on URL path.
 *
 * If no view is found, the routes-list is regenerated to find newly generated templates.
 * @param req
 * @param res
 * @param next
 */
Find view template based on URL path.
If no view is found, the routes-list is regenerated to find newly generated templates.
Find view template based on URL path . If no view is found the routes - list is regenerated to find newly generated templates .
function resolveView(req, res, next) {
	var urlPath = req.path ? path.basename(req.path, path.extname(req.path)) : 'index';
	function hasRoute(urlPath) {
		return routes.hasOwnProperty(urlPath);
	}
	if (hasRoute(urlPath)) {
		render(res, urlPath);
	} else {
		createRoutes();
		if (hasRoute(urlPath)) {
			render(res, urlPath);
		} else {
			next();
		}
	}
}
function resolveView ( req , res , next ) { var urlPath = req . path ? path . basename ( req . path , path . extname ( req . path ) ) : 'index' ; function hasRoute ( urlPath ) { return routes . hasOwnProperty ( urlPath ) ; } if ( hasRoute ( urlPath ) ) { render ( res , urlPath ) ; } else { createRoutes ( ) ; if ( hasRoute ( urlPath ) ) { render ( res , urlPath ) ; } else { next ( ) ; } } }
Find view template based on URL path.
Find view template based on URL path .
// Regenerate routes if route was not found, in case view file was created after nitro was started.