Fix Routing suffix loading

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@extollo/lib", "name": "@extollo/lib",
"version": "0.10.1", "version": "0.10.2",
"description": "The framework library that lifts up your code.", "description": "The framework library that lifts up your code.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@ -12,6 +12,7 @@ import {PackageDiscovered} from '../support/PackageDiscovered'
import {staticServer} from '../http/servers/static' import {staticServer} from '../http/servers/static'
import {Bus} from '../support/bus' import {Bus} from '../support/bus'
import {RequestLocalStorage} from '../http/RequestLocalStorage' 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. * 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.') this.logging.verbose('Registering @extollo view engine namespace.')
engine.registerNamespace('extollo', lib().concat('resources', 'views')) engine.registerNamespace('extollo', lib().concat('resources', 'views'))
const suffix = `.routes${env('NODE_SCRIPT_SUFFIX', '.js')}`
for await ( const entry of this.path.walk() ) { 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}`) this.logging.debug(`Skipping routes file with invalid suffix: ${entry}`)
continue continue
} }