|
|
|
@ -12,6 +12,7 @@ import {PackageDiscovered} from '../support/PackageDiscovered'
|
|
|
|
|
import {staticServer} from '../http/servers/static'
|
|
|
|
|
import {Bus} from '../support/bus'
|
|
|
|
|
import {RequestLocalStorage} from '../http/RequestLocalStorage'
|
|
|
|
|
import {env} from '../lifecycle/Application'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Application unit that loads the various route files from `app/http/routes` and pre-compiles the route handlers.
|
|
|
|
@ -38,8 +39,9 @@ export class Routing extends Unit {
|
|
|
|
|
this.logging.verbose('Registering @extollo view engine namespace.')
|
|
|
|
|
engine.registerNamespace('extollo', lib().concat('resources', 'views'))
|
|
|
|
|
|
|
|
|
|
const suffix = `.routes${env('NODE_SCRIPT_SUFFIX', '.js')}`
|
|
|
|
|
for await ( const entry of this.path.walk() ) {
|
|
|
|
|
if ( !entry.endsWith('.routes.js') ) {
|
|
|
|
|
if ( !entry.endsWith(suffix) ) {
|
|
|
|
|
this.logging.debug(`Skipping routes file with invalid suffix: ${entry}`)
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|