add day 40
This commit is contained in:
17
day40/src/entry-server.ts
Normal file
17
day40/src/entry-server.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user