- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在用 Go 编写云函数并从 firestore 模拟器触发它们。如果我手动启动 firestore 模拟器,这会起作用:
java -jar ~/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar \
--functions_emulator localhost:5001
然后我在 localhost:5001 上启动我自己的服务器来处理触发的函数,一切似乎都正常工作。
但是,我想以正常方式启动 firestore 模拟器这样我就得到了漂亮的网络用户界面等。我的 firebase.json 文件如下:
{
"emulators": {
"firestore": {
"port": 8080
},
"functions": {
"port": 5001
},
"pubsub": {
"port": 8085
},
"ui": {
"enabled": true
},
"hosting": {
"port": 5000
},
"auth": {
"port": 9099
}
},
"ui": {
"enabled": true,
"host": "localhost",
"port": 4000
},
"functions": {
"port": "5001",
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint",
"npm --prefix \"$RESOURCE_DIR\" run build"
],
"source": "functions"
},
"pubsub": {
"port": "8085"
},
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
我使用以下命令启动模拟器
firebase emulators:start --only firestore
然后我使用以下命令在 firestore 上设置触发器:
#!/bin/zsh
TRIGGER='http://localhost:8080/emulator/v1/projects/fugalist/triggers/Requests'
curl --location --request PUT ${TRIGGER} \
--header 'Content-Type: application/json' \
--data-raw '{
"eventTrigger": {
"resource": "projects/fugalist/databases/(default)/documents/Requests/{doc}",
"eventType": "providers/cloud.firestore/eventTypes/document.create",
"service": "firestore.googleapis.com"
}
}'
最后,我在/Requests 下手动创建了一个文档。 firestore-debug.log 现在包含:
[debug] [2020-11-10T21:09:20.187Z] ----------------------------------------------------------------------
[debug] [2020-11-10T21:09:20.189Z] Command: /usr/local/Cellar/node/12.4.0/bin/node /Users/michaelcoffin/node_modules_global/bin/firebase emulators:start --only firestore
[debug] [2020-11-10T21:09:20.189Z] CLI Version: 8.15.0
[debug] [2020-11-10T21:09:20.189Z] Platform: darwin
[debug] [2020-11-10T21:09:20.189Z] Node Version: v12.4.0
[debug] [2020-11-10T21:09:20.190Z] Time: Tue Nov 10 2020 13:09:20 GMT-0800 (Pacific Standard Time)
[debug] [2020-11-10T21:09:20.190Z] ----------------------------------------------------------------------
[debug] [2020-11-10T21:09:20.190Z]
[debug] [2020-11-10T21:09:20.197Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-11-10T21:09:20.197Z] > authorizing via signed-in user
[info] i emulators: Starting emulators: firestore {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: firestore"}}
[debug] [2020-11-10T21:09:20.210Z] [hub] writing locator at /var/folders/xy/m2rx3tw14mnfvryxx2jvhyjh0000gn/T/hub-fugalist.json
[debug] [2020-11-10T21:09:20.229Z] Ignoring unsupported arg: projectId {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: projectId"}}
[debug] [2020-11-10T21:09:20.229Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"firestore"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2020-11-10T21:09:20.229Z] Starting Firestore Emulator with command {"binary":"java","args":["-Duser.language=en","-jar","/Users/michaelcoffin/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar","--host","localhost","--port",8080,"--rules","/Users/michaelcoffin/expmap/fe/firestore.rules"],"optionalArgs":["port","webchannel_port","host","rules","functions_emulator","seed_from_export"],"joinArgs":false} {"metadata":{"emulator":{"name":"firestore"},"message":"Starting Firestore Emulator with command {\"binary\":\"java\",\"args\":[\"-Duser.language=en\",\"-jar\",\"/Users/michaelcoffin/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar\",\"--host\",\"localhost\",\"--port\",8080,\"--rules\",\"/Users/michaelcoffin/expmap/fe/firestore.rules\"],\"optionalArgs\":[\"port\",\"webchannel_port\",\"host\",\"rules\",\"functions_emulator\",\"seed_from_export\"],\"joinArgs\":false}"}}
[info] i firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[debug] [2020-11-10T21:09:21.040Z] API endpoint: http:// {"metadata":{"emulator":{"name":"firestore"},"message":"API endpoint: http://"}}
[debug] [2020-11-10T21:09:21.040Z] localhost:8080
If you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:
export FIRESTORE_EMULATOR_HOST=localhost:8080
Dev App Server is now running.
{"metadata":{"emulator":{"name":"firestore"},"message":"localhost:8080\nIf you are using a library that supports the FIRESTORE_EMULATOR_HOST environment variable, run:\n\n export FIRESTORE_EMULATOR_HOST=localhost:8080\n\nDev App Server is now running.\n\n"}}
[warn] ⚠ ui: Emulator UI unable to start on port 4000, starting on 4003 instead. {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI unable to start on port 4000, starting on 4003 instead."}}
[debug] [2020-11-10T21:09:21.275Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
[debug] [2020-11-10T21:09:21.275Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
[debug] [2020-11-10T21:09:21.275Z] Starting Emulator UI with command {"binary":"node","args":["/Users/michaelcoffin/.cache/firebase/emulators/ui-v1.2.2/server.bundle.js"],"optionalArgs":[],"joinArgs":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {\"binary\":\"node\",\"args\":[\"/Users/michaelcoffin/.cache/firebase/emulators/ui-v1.2.2/server.bundle.js\"],\"optionalArgs\":[],\"joinArgs\":false}"}}
[info] i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
[debug] [2020-11-10T21:09:21.369Z] Web / API server started at http://localhost:4003
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at http://localhost:4003\n"}}
[info]
┌───────────────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! View status and logs at http://localhost:4003 │
└───────────────────────────────────────────────────────────────────────┘
┌───────────┬────────────────┬─────────────────────────────────┐
│ Emulator │ Host:Port │ View in Emulator UI │
├───────────┼────────────────┼─────────────────────────────────┤
│ Firestore │ localhost:8080 │ http://localhost:4003/firestore │
└───────────┴────────────────┴─────────────────────────────────┘
Other reserved ports: 4400, 4500
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
[debug] [2020-11-10T21:09:24.814Z] Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\nNov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:24.814Z] Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:24.944Z] Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:24 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:25.386Z] Nov 10, 2020 1:09:25 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:25 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:32.373Z] Nov 10, 2020 1:09:32 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:32 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:40.867Z] Nov 10, 2020 1:09:40 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:40 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:41.511Z] Nov 10, 2020 1:09:41 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:41 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:09:41.521Z] Nov 10, 2020 1:09:41 PM com.google.cloud.datastore.emulator.impl.context.EmulatorAuthorization warnAboutSecuredJwt
WARNING: expected an unsecured JWT, the emulator does not validate JWTs and IS NOT SECURE
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:41 PM com.google.cloud.datastore.emulator.impl.context.EmulatorAuthorization warnAboutSecuredJwt\nWARNING: expected an unsecured JWT, the emulator does not validate JWTs and IS NOT SECURE\n"}}
[debug] [2020-11-10T21:09:41.629Z] Nov 10, 2020 1:09:41 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:09:41 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:10:21.137Z] Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:10:21.165Z] Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:10:21.179Z] Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:10:21.225Z] Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:10:21 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead\nINFO: Detected non-HTTP/2 connection.\n"}}
[debug] [2020-11-10T21:10:21.239Z] Nov 10, 2020 1:10:21 PM com.google.cloud.datastore.emulator.impl.events.EventLogger publishEvent
WARNING: Failed to publish event for trigger projects/fugalist/triggers/Requests because Functions Emulator host/port is not configured.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:10:21 PM com.google.cloud.datastore.emulator.impl.events.EventLogger publishEvent\nWARNING: Failed to publish event for trigger projects/fugalist/triggers/Requests because Functions Emulator host/port is not configured.\n"}}
在我手动创建文档后立即出现的相关部分是最后一个条目:
WARNING: Failed to publish event for trigger projects/fugalist/triggers/Requests because Functions Emulator host/port is not configured.
{"metadata":{"emulator":{"name":"firestore"},"message":"Nov 10, 2020 1:10:21 PM com.google.cloud.datastore.emulator.impl.events.EventLogger publishEvent\nWARNING: Failed to publish event for trigger projects/fugalist/triggers/Requests because Functions Emulator host/port is not configured.\n"}}
实际上,ps 显示 --functions_emulator 标志未在 firestore 模拟器的调用中使用:
michaelcoffin 98802 0.0 1.6 16006468 536636 ?? Ss 1:09PM 0:06.19 /usr/bin/java -Duser.language=en -jar /Users/michaelcoffin/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar --host localhost --port 8080 --rules /Users/michaelcoffin/expmap/fe/firestore.rules
而且,事实上,如果您要求模拟器功能,它是使用的:
firebase emulators:start --only firestore,functions
ps output:
99072 0.0 1.2 15892768 391240 ?? Ss 1:41PM 0:04.17 /usr/bin/java -Duser.language=en -jar /Users/michaelcoffin/.cache/firebase/emulators/cloud-firestore-emulator-v1.11.9.jar --host localhost --port 8080 --rules /Users/michaelcoffin/expmap/fe/firestore.rules --functions_emulator localhost:5001
我知道这不完全是一个错误,因为模拟器套件并不正式支持用 Go 编写的 Google Cloud Functions。但是,如果我使用 --functions_emulator 标志手动启动 firestore 模拟器,模拟器套件确实实际上可以与 Go 一起正常工作。所以我试图找到一个解决方法,以便即使在函数模拟器未启动时也使用 --functions_emulator 标志。
最佳答案
Firebase CLI 不提供通过 firebase emulators:start
命令设置主机和端口的标志。尽管如此,您仍可以在 firebase.json
文件中控制所有模拟器的端口设置。其中您应该看到下面的配置,您可以在其中替换端口值:
"emulators": {
"firestore": {
"port": 8500
},
"ui": {
"enabled": true,
"port": 4040
}
}
关于主机,默认情况下它被设置为 localhost,所以这应该不是问题。
关于firebase - 如何指定主机:port of the functions emulator without starting the functions emulator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64706995/
我正在我的 java 作业中使用 GUI,并且我必须指定 JCheckBox 中的其他内容。除了这个小要求,其他的我都完成了。我不太确定如何解决这个问题,我查阅了我的书并尝试在线研究 要求: 一系列复
在各种语言中(我将在这里使用 JavaScript,但我已经在 PHP 和 C++ 中以及可能在其他地方看到过它),似乎有几种构造简单 for 循环的方法。版本 1 如下: var top = doc
有没有一种方法可以使用 CSS 指定每次“小于符号”(在键盘上 M 的右侧)或“大于符号”出现在文本中时,它应该被替换为分别是“小于”或“大于”的实际词? 最佳答案 CSS 不能作用于(不能修改,即)
首先,使用 setspn 命令为用户注册服务主体名称。 setspn -a CS/dummy@abc.com dummyuser setspn -l dummyuser 给出输出为 CS/dummy@
我在指定从 SFSafariViewController 访问时遇到问题,因为它具有与 Safari 浏览器完全相同的用户代理。 我要做的是仅在 webview 内显示图片,如果在普通浏览器上查看,则
我正在尝试用 R 语言在 lavaan 中指定一个奇怪的模型。该模型如下所示: 我的规范尝试如下所示。我发现难以实现的是将观察到的变量的唯一误差固定为唯一项的两个相关性的总和。 例如,项目 y*1,2
我正在构建 API 以将我的 React 应用程序与我的后端服务连接起来,我想使用 typescript 来指定 data 的类型在我的 Axios 请求中。如何在不修改其他字段的情况下更新 Axio
如何为模型指定初始“软”值?该初始模型是解决类似查询的结果,并且该模型很可能具有正确的部分,甚至对于当前查询可能是正确的。 目前,我正在通过增量求解和 hard/soft constraints 对此
我有来自网页的以下代码 https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+Producer+Example 似乎缺少的是如何配置分区数。我
有没有办法在每个查询的基础上在 Neo4jClient 中指定 Cypher 解析器的版本,如 here 所述? 谢谢! 最佳答案 如果您将 Neo4jClient 更新到最新版本(> 1.0.0.6
我有以下代码生成四个图,但它们最终被压扁(见下图)。我该如何解决这个问题? par(mfrow=c(2,2)) curve(.5*exp(-.5*x),from=0,to=10,main="f(x)"
我有一个 ColdFusion 10 服务器。我正在使用 JDBC 驱动程序连接到 db2 数据库。我偶然发现了这个笔记。这个设置在哪里?我还查看了 neo*.xml 文件,但没有看到任何 db 驱动
我想知道是否可以指定验证器的运行顺序。 目前,我编写了一个自定义验证器,检查它是否为 [a-zA-Z0-9]+ 以确保登录验证我们的规则,并编写了一个远程验证器以确保登录可用,但目前远程验证器已启动在
我的应用程序需要至少 40MB 的 RAM,因此早期的 iPhone(例如 3G、第一个 iPod touch 版本)就没有它(它们为我的应用程序提供的最大内存约为 20MB)。有没有正确的方法来禁用
我有一个保存日期(不是当前日期)的 Date 对象,我需要以某种方式指定该日期为 UTC,然后将其转换为“欧洲/巴黎”,即 +1 小时。 public static LocalDateTime toL
我想问你在 Varnish 代码中如何在没有缓存的情况下将请求传递到后端。 我知道我可以做到并且正在发挥作用: if (req.url ~ "(\?|&)(something|somethin
我目前基于模块编译程序(如主程序 foo 依赖于模块 bar )如下: gfortran -c bar.f90 gfortran -o foo.exe foo.f90 bar.o 这在 foo.f90
我正在尝试创建一个依赖于另一个 meteor 包的新 meteor 包。当我尝试 meteor add mypackage 时,出现以下错误。为什么 Meteor 不添加 mypackage 并引入它
我正在制作执行器/ react 器,同时发现这是一个终生的问题。它与 async/Future 无关,可以在没有 async 糖的情况下进行复制。 use std::future::Future; s
我在 cassandra 中有一个表,其数据类型为时间戳。我正在使用 cqlsh 从数据库中获取数据,并希望更改我的时间戳列输出的输出格式。我研究了一下,发现我可以通过更改以下文件来更改时间戳输出格式
我是一名优秀的程序员,十分优秀!