Hosting an HTML page on a Meteor app

237 Views Asked by At

I have a Meteor app and would like to host an HTML page.

I can put my index.html page and content inside meteors public/main/ folder, so it would be accessible by 127.0.0.1/main/index.html.

But surely there must be a better way. I have the Kadira FlowRouter package and Blaze templates if it helps.

I tried:

FlowRouter.route('/main', {
  action(params) {
    window.location.href=pathToPage;
  }
});

But it didn't work when moving my page out of the public folder.

The page itself is an HTML and javascript page.

1

There are 1 best solutions below

0
On

Try using the static-html package.

From the package description:

Essentially, an alternative to the templating package that doesn't compile Blaze templates. Mostly useful if you want to use Angular or React as your view layer and just want to get some static HTML content on your page as a render target for your view framework.

This build plugin parses all of the .html files in your app and looks for top-level tags:

- appended to the head section of your HTML - appended to the body section of your HTML Attributes are supported on the tag, but not on .