1

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

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

路由器.js

4

1 回答 1

2

我会尝试创建一条路线:

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
}
于 2013-12-11T11:08:02.217 回答