mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
374 B
13 lines
374 B
// entry for SSR
|
|
import { createApp } from './index.js'
|
|
import { renderToString } from 'vue/server-renderer'
|
|
import type { SSGContext } from '../shared.js'
|
|
|
|
export async function render(path: string) {
|
|
const { app, router } = await createApp()
|
|
await router.go(path)
|
|
const ctx: SSGContext = { content: '' }
|
|
ctx.content = await renderToString(app, ctx)
|
|
return ctx
|
|
}
|