Fix Routing suffix loading

master
Garrett Mills 2 years ago
parent d3a6a8495c
commit 111ce0bcf9

@ -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",

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

Loading…
Cancel
Save