Fix Routing suffix loading

This commit is contained in:
2022-07-08 21:03:01 -05:00
parent d3a6a8495c
commit 111ce0bcf9
2 changed files with 4 additions and 2 deletions

View File

@@ -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
}