gpt4 book ai didi

javascript - Meteor.js 公用文件夹不提供 .html 文件

转载 作者:行者123 更新时间:2023-11-30 17:43:50 24 4
gpt4 key购买 nike

我有一个来自 Google 的 .html 文件,我需要在 http://www.domain.com/google1234567890123456.html 上提供该文件。我将 .html 文件放入 pathToMeteorApp/public/ 但是当我访问该 URL 时,Meteor 为我提供了一个带有一些模板的空白页面。

我正在使用 iron-router,那么即使 .html 文件位于公用文件夹中,路由器是否仍在管理 .html 文件的 url?如果是这样,我们如何防止这种情况发生并直接在该网址提供 .html 文件?

router.js

最佳答案

我会尝试创建一条路线:

Router.map(function() {
this.route('google', {
path: '/google1234567890123456.html'
});
});

和模板:

<template name="google">
<!-- Your google1234567890123456.html content in <body></body> here -->
</template>

如果它包含任何脚本,您可以在渲染函数中执行它们:

//client code
Template.google.rendered = function() {
//execute google scripts
}

关于javascript - Meteor.js 公用文件夹不提供 .html 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20510745/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com