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

标签 javascript node.js meteor meteorite iron-router

我有一个来自 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/

相关文章:

javascript - 查询 : How to force the click of s specific item of a radiobox

javascript - Ajax:如何获取具有动态生成的 ID 的元素的值

node.js - Paypal API : REST or CLASSIC?

javascript - Fabric.js 缩放整个图像的最简单方法

javascript - Iron-Router,重定向和渲染有什么区别?

javascript - 为函数添加条件,使其仅在特定情况下运行

javascript - 使用 Node.js 和 express-handlebars 从 JSON 文件渲染 html

node.js - NG Live Development Server 与传统 Web 服务器

javascript - meteor 事件 map ?

twitter-bootstrap - meteor 编译自定义 Bootstrap 少的例子?