support route handler arguments; add daton::static file server

This commit is contained in:
2020-09-05 08:58:34 -05:00
parent 27ee1a552b
commit 601649e699
18 changed files with 231 additions and 32 deletions

2
app/assets/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -9,3 +9,4 @@ export { default as HttpServerUnit } from '../../lib/src/unit/HttpServer.ts'
export { default as RoutingUnit } from '../../lib/src/unit/Routing.ts'
export { default as ServicesUnit } from '../../lib/src/unit/Services.ts'
export { default as ViewEngineUnit } from '../../lib/src/unit/ViewEngine.ts'
export { default as DatonMiddlewareUnit } from '../../lib/src/unit/DatonMiddleware.ts'

View File

@@ -14,5 +14,5 @@ export default {
session: {
driver: 'database', // memory | database
model: 'http:Session', // required for database
}
},
}

View File

@@ -6,5 +6,6 @@ export default {
get: {
'/': 'controller::Home.get_home',
'/maybe': ['middleware::Test', 'controller::Home.get_home'],
'/statics/**': { handler: 'daton::static', arg: 'assets' },
},
} as RouterDefinition

View File

@@ -10,6 +10,7 @@ import {
RoutingUnit,
ServicesUnit,
ViewEngineUnit,
DatonMiddlewareUnit,
} from './bundle/daton_units.ts'
export default [
@@ -19,6 +20,7 @@ export default [
ModelsUnit,
ViewEngineUnit,
HttpKernelUnit,
DatonMiddlewareUnit,
MiddlewareUnit,
ControllerUnit,
RoutesUnit,