简体   繁体   English

苗条的苗条适配器火力基地 function 设置

[英]svelte svelte-adapter-firebase function setup

I have been messing around with new Svelte SSR adapters since the future of Svelte will not use Sapper.因为 Svelte 的未来不会使用 Sapper,所以我一直在搞乱新的 Svelte SSR 适配器。 I am trying to create a firebase function for SSR, but I can't seem to find any clue on how to do this.我正在尝试为 SSR 创建一个 firebase function,但我似乎找不到任何关于如何执行此操作的线索。

This guide tells you how to implement Svelte so that it can use Firebase Functions.本指南告诉您如何实现 Svelte,以便它可以使用 Firebase 函数。 I have no problem there, but I do not see anywhere on how to setup the firebase function itself:我在那里没有问题,但我看不到如何设置 firebase function 本身:

Installing Svelte@next安装 Svelte@next

https://carlosvin.github.io/posts/svelte-next-bright-future-with-snowpack/en/ https://carlosvin.github.io/posts/svelte-next-bright-future-with-snowpack/en/

https://github.com/jthegedus/svelte-adapter-firebase https://github.com/jthegedus/svelte-adapter-firebase

In my actual index.js or index.ts firebase function file, I do not know what to call.在我实际的index.jsindex.ts firebase function 文件中,我不知道该调用什么。 I am thinking something like this:我在想这样的事情:

const functions = require("firebase-functions");

const next = require("./build/index.js");

exports.ssr = functions.https.onRequest(next);

I believe I am missing something so simple.我相信我错过了这么简单的东西。 Any ideas?有任何想法吗?


Sapper SSR Resources Sapper SSR 资源

Author of the Firebase adapter here. Firebase 适配器的作者在这里。

There was an update with SvelteKit that by default disabled the logging level the adapter was using to guide you through the process. SvelteKit 有一个更新,默认情况下禁用适配器用来指导您完成整个过程的日志记录级别。

Please try the latest version of the adapter ( 0.5.0 ) with the caveat that SvelteKit is still in alpha so the adapter can be broken by updates there.请尝试最新版本的适配器 ( 0.5.0 ),但需要注意的是 SvelteKit 仍处于 alpha 状态,因此适配器可能会被那里的更新破坏。 svelte-adapter-firebase@0.5.0 was tested and working against @sveltejs/kit@1.0.0-next.49 svelte-adapter-firebase@0.5.0经过测试并针对@sveltejs/kit@1.0.0-next.49

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM