Serving an “index.html” file in public/ when using MeteorJS and Iron Router?

前端 未结 2 528
情话喂你
情话喂你 2021-01-05 16:54

I want to serve a static HTML file from MeteorJS\'s public folder (as is possible with Rails and Express). The reason I\'m doing this is because I have one template for the

2条回答
  •  囚心锁ツ
    2021-01-05 17:39

    this is what I put in bootstrap.js

    Router.route('/', {
      where: 'server'
    }).get(function() {
      var contents;
      contents = Assets.getText('index.html');
      return this.response.end(contents);
    });
    

提交回复
热议问题