add day 41

This commit is contained in:
Zoe
2022-11-02 23:06:50 -05:00
parent a1129718c3
commit 37da2156ad
43 changed files with 11315 additions and 0 deletions

17
day41/src/entry-server.ts Normal file
View File

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