feat(domains) implement domain routing; Logger

This commit is contained in:
gh0sTedBuddy
2024-03-20 03:43:27 +00:00
parent f303b67409
commit b5e8ce3144
15 changed files with 907 additions and 187 deletions

View File

@@ -1,6 +1,7 @@
import MimeTypeMap from './MimeTypeMap';
export default class LayResponse {
routing = undefined;
body;
statusCode;
headerList = new Map();
@@ -9,8 +10,8 @@ export default class LayResponse {
disableFileCheck: false,
};
constructor(router) {
this.router = router;
constructor(routing) {
this.routing = routing;
this.body = 'Not Implemented';
this.statusCode = 502;
this.headerList = new Map();
@@ -101,7 +102,7 @@ export default class LayResponse {
}
async render(path, data = {}) {
const loader = await this.router.getServer().load(path);
const loader = await this.routing.getServer().load(path);
const content = await loader.parse(data, {
status: this.status(),
headers: this.headers(),