parent
2b2799c937
commit
c31460c0cc
@ -0,0 +1,8 @@
|
|||||||
|
import {env} from "@extollo/lib"
|
||||||
|
import {ORMSession} from "@extollo/orm"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
session: {
|
||||||
|
driver: ORMSession,
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
import {json, Logging, Middleware} from "@extollo/lib";
|
||||||
|
import {Inject, Injectable} from "@extollo/di";
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class LogRequest extends Middleware {
|
||||||
|
@Inject()
|
||||||
|
protected readonly logging!: Logging
|
||||||
|
|
||||||
|
public async apply() {
|
||||||
|
this.logging.info(`Incoming request: ${this.request.method} @ ${this.request.path}`)
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,3 @@
|
|||||||
import {Request, Route} from "@extollo/lib"
|
import {Request, Route} from "@extollo/lib"
|
||||||
|
|
||||||
Route.get('/', 'main:Home.welcome')
|
Route.get('/', 'main:Home.welcome').pre('LogRequest')
|
||||||
|
Loading…
Reference in new issue