Meteor.js public folder not serving .html file
Asked Answered
C

1

1

I have a .html file from Google that I need to serve at http://www.domain.com/google1234567890123456.html. I placed the .html file into pathToMeteorApp/public/ but when I visit that URL, Meteor serves me an empty page with some template.

I'm using iron-router, so is it possible that the router is still managing the url to the .html file even though the .html file is in the public folder? If so, how can we prevent that and serve the .html file directly at that url?

router.js

Cyril answered 11/12, 2013 at 4:49 Comment(2)
That is possible. Can you share your defined iron-router routes?Incision
@ChristianF Sure, updated post with routesCyril
F
2

I would try to create a route:

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

and template:

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

If it contains any scripts you can execute them in rendered function:

//client code
Template.google.rendered = function() {
    //execute google scripts
}
Furious answered 11/12, 2013 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.