day 28 - pre-render cokies for lack of a better word

This commit is contained in:
Zoe
2022-10-20 21:55:22 -05:00
parent 59c755501b
commit b60a398627
38 changed files with 10289 additions and 0 deletions

15
day28/src/entry-server.ts Normal file
View File

@@ -0,0 +1,15 @@
import { compileToString } from './lib/templateRenderer';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { appState } from './main';
let ctx = {};
export function SSRPage(template: string) {
return compileToString(template);
}
export function setContext(context: Record<string, unknown>) {
ctx = context;
}
export function getContext() {
return ctx;
}