diff --git a/packages/fastify-vue/rendering.js b/packages/fastify-vue/rendering.js index 35db2cb..08f57f1 100644 --- a/packages/fastify-vue/rendering.js +++ b/packages/fastify-vue/rendering.js @@ -16,28 +16,21 @@ export async function createRenderFunction ({ routes, create }) { } } -async function createStreamingResponse (req, routes, routeMap, create) { - // Vue application instance - const app = await create({ - routes, - routeMap, - ctxHydration: req.route, - url: req.url, - }) +async function createStreamingResponse (req, routes) { + req.route.router.push(req.url) + await req.route.router.isReady() // SSR stream - const body = renderToNodeStream(app.instance, app.ctx) + const body = renderToNodeStream(req.route.app, req.route.ssrContext) return { routes, context: req.route, body } } -async function createResponse (req, routes, routeMap, create) { - console.log('createResponse()') +async function createResponse (req, routes) { let body if (!req.route.clientOnly) { req.route.router.push(req.url) await req.route.router.isReady() // SSR string body = await renderToString(req.route.app, req.route.ssrContext) - console.log('req.route.ssrContext', req.route.ssrContext) } return { routes, context: req.route, body } }