From d71c63a3a32592e8d2bd1023f5f683451f30112c Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 4 Feb 2024 15:32:14 +0100 Subject: [PATCH] Render templates on the server --- plugs/template/template.plug.yaml | 1 + server/server_system.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugs/template/template.plug.yaml b/plugs/template/template.plug.yaml index 74ad7a2b..a5502648 100644 --- a/plugs/template/template.plug.yaml +++ b/plugs/template/template.plug.yaml @@ -2,6 +2,7 @@ name: template functions: # API renderTemplate: + env: server path: api.ts:renderTemplate cleanTemplate: diff --git a/server/server_system.ts b/server/server_system.ts index 4020de76..b802cd16 100644 --- a/server/server_system.ts +++ b/server/server_system.ts @@ -73,11 +73,6 @@ export class ServerSystem { // Always needs to be invoked right after construction async init(awaitIndex = false) { - this.ds = new DataStore( - this.kvPrimitives, - buildQueryFunctions(this.allKnownPages, this.system), - ); - this.system = new System( "server", { @@ -89,6 +84,11 @@ export class ServerSystem { }, ); + this.ds = new DataStore( + this.kvPrimitives, + buildQueryFunctions(this.allKnownPages, this.system), + ); + // Event hook const eventHook = new EventHook(); this.system.addHook(eventHook);