Add basic memory-based session driver

This commit is contained in:
2021-03-07 13:26:14 -06:00
parent fdcd80a43e
commit 338b9be506
7 changed files with 202 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ import {Request} from "../http/lifecycle/Request";
import {HTTPKernel} from "../http/kernel/HTTPKernel";
import {PoweredByHeaderInjectionHTTPModule} from "../http/kernel/module/PoweredByHeaderInjectionHTTPModule";
import {SetSessionCookieHTTPModule} from "../http/kernel/module/SetSessionCookieHTTPModule";
import {InjectSessionHTTPModule} from "../http/kernel/module/InjectSessionHTTPModule";
import {PersistSessionHTTPMiddleware} from "../http/kernel/module/PersistSessionHTTPMiddleware";
@Singleton()
export class HTTPServer extends Unit {
@@ -23,6 +25,8 @@ export class HTTPServer extends Unit {
// TODO register these by config
PoweredByHeaderInjectionHTTPModule.register(this.kernel)
SetSessionCookieHTTPModule.register(this.kernel)
InjectSessionHTTPModule.register(this.kernel)
PersistSessionHTTPMiddleware.register(this.kernel)
await new Promise<void>((res, rej) => {
this.server = createServer(this.handler)