我正在尝试创建一些 Firebase Cloud Functions 并使用本地测试它们
firebase emulators:start --only functions
Run Code Online (Sandbox Code Playgroud)
这些函数应该使用 fetch 调用一些外部服务。
我发现在将函数部署到 Firebase 云时可以调用这些外部服务,但在模拟器中本地运行时无法调用它们:
import 'cross-fetch/polyfill';
export const fetchTest = functions
.region(config.firebaseRegion)
.https.onRequest((request: Request, response: Response) => {
fetch("https://www.wikipedia.org/", {
method: 'GET',
}).then(value => {
console.log("Fetched: ", value);
}).catch(reason => {
console.log("Fetch failed: ", reason);
});
fetch("https://googleapis.com/foo", {
method: 'GET',
}).then(value => {
console.log("Fetched: ", value);
}).catch(reason => {
console.log("Fetch failed: ", reason);
});
response.send("Done");
});
Run Code Online (Sandbox Code Playgroud)
这是我在模拟器中调用 fetchTest 时得到的输出:
? Unknown network resource requested!
- URL: "https://www.wikipedia.org/"
? Google …Run Code Online (Sandbox Code Playgroud) 我刚开始使用JHipster,我正在试验5.0.0-beta.1.我试图用React前端创建一个简单的应用程序.
我还尝试导入https://www.jhipster.tech/jdl/中描述的示例JDL模型(Oracle"人力资源"示例应用程序)
我做了一个
jhipster import-jdl my_file.jdl
Run Code Online (Sandbox Code Playgroud)
一切顺利,每个人都像宣传的那样工作.然而,在前端,所有实体都有一个"my-suffix"后缀,甚至在屏幕上它们显示为"Region My Suffix","Country My Suffix"等.
在阅读文档后,我发现了"Angular suffix"的概念并尝试过
jhipster import-jdl my_file.jdl --force --angular-suffix=""
Run Code Online (Sandbox Code Playgroud)
但无济于事.
那么,有没有办法摆脱后缀或将其设置为有意义的值?