weixin_33736832 2016-08-08 20:43 采纳率: 0%
浏览 47

PrerenderIO流星用法

I am attempting to use the prerenderIO Package in my meteor web app and am not sure if I am using it correctly. I followed to instructions on the package and have added the package to my webapp, then set my prerenderIO token in my settings.json file like so...

settings.json

{
"PrerenderIO": {
    "token": "XXXXXXXXXXXXXX"

},
"public": {

},
"private": {



}
}

Is there another step that I am missing? Do I need to call a method somewhere? Any insight would be hugely appreciated and thank you in advanced.

  • 写回答

1条回答 默认 最新

  • weixin_33749242 2016-08-09 17:07
    关注

    Follow these steps to get prerender.io setup and tested with your Meteor app locally:

    1) Install the dfischer:prerenderio package:

    meteor add dfischer:prerenderio
    

    2) Add the Prerender settings to your settings.json file:

    {
      "PrerenderIO": {
        "token": "yourtoken"
      }
    }
    

    3) Start your app locally (making sure to reference your settings.json):

    meteor --settings=settings.json
    

    4) Install and start a local Prerender server for testing (make sure you change the default port of 3000 since it will conflict with Meteor's default port):

    git clone https://github.com/prerender/prerender.git
    cd prerender
    npm install
    export PORT=3100 
    node server.js
    

    5) Access your local Meteor app through your local Prerender instance:

    http://localhost:3100/http://localhost:3000
    

    6) In your browser, view source; you'll see the rendered HTML for your application instead of referenced javascript files/calls.

    评论

报告相同问题?