http://mohiplanet.blogspot.com/2014/07/installconfigure-and-run-html-pre.html
Have a look at util.js :
https://github.com/prerender/prerender/blob/master/lib/util.js
on line 32 - line 35.You will see something like this:
- var newUrl = url.format(parts);
- if(newUrl[0] === '/') newUrl = newUrl.substr(1);
- return newUrl;
- };
Something like:
- var newUrl = url.format(parts);
- if(newUrl[0] === '/') newUrl = newUrl.substr(1);
- newUrl=mapurl(newUrl);
- return newUrl;
- };
map url function:
- function mapurl(turl){
- var url=turl;
- if(url.indexOf('www.mysite.com') > -1){
- url=url.replace('www.mysite.com','localhost:8080');
- return url+'';
- }
- if(url.indexOf('mysite.com') > -1){
- url=url.replace('mysite.com','localhost:8080');
- return url+'';
- }
- return url+'';
- }
Now: http://localhost:3000/http://www.mysite.com/ will be mapped to :
This will work if our app is hosted locally at http://localhost:8080/ and locally setup prerender port is 3000
No comments:
Post a Comment