Coder Social home page Coder Social logo

Comments (68)

heston avatar heston commented on June 15, 2024 8

Has anyone seen (or created) a middleware that works with Flask?

from prerender.

sivsushruth avatar sivsushruth commented on June 15, 2024 4

If there is a demand, I can create one for Phoenix (Elixir). Let me know.

from prerender.

vizo avatar vizo commented on June 15, 2024 1

@sivsushruth yes please .... πŸ‘

from prerender.

Stanback avatar Stanback commented on June 15, 2024

It's also possible to use the prerender service as a proxy with Nginx.

Edit - the configuration is now in this Gist: https://gist.github.com/Stanback/6998085

This config will serve existing files directly and use index.html for any other URLs (hash bang, push state, etc). A prerendered page is shown for the list of user agents or by manually appending the query string ?prerender=1 to the URL.

from prerender.

stumpyfr avatar stumpyfr commented on June 15, 2024

nice solution :)

from prerender.

thoop avatar thoop commented on June 15, 2024

@Stanback Awesome! Will you make a public gist of that? That way people can fork/edit/share it.

Can you also make it point to prerender.herokuapp.com and can you check the query string for the key _escaped_fragment_? That way it will work out of the box for people.

Once you do, let me know and I'll add it to prerender.io and the list of middleware.

Thanks a ton!

from prerender.

thoop avatar thoop commented on June 15, 2024

I updated this issue and prerender.io with Nginx. Thanks @Stanback!

from prerender.

runxc1 avatar runxc1 commented on June 15, 2024

Anyone started on asp.net mvc?

from prerender.

thoop avatar thoop commented on June 15, 2024

@runxc1 nope! I'll add it to the list above.

from prerender.

greengerong avatar greengerong commented on June 15, 2024

Prerender for java framrwork[https://github.com/greengerong/prerender-java].
It use java filter to implement. How to use it , please see the demo project on this repo.

Thanks

from prerender.

thoop avatar thoop commented on June 15, 2024

@greengerong Nice work! I'll add it to the website and readme tonight.

from prerender.

greengerong avatar greengerong commented on June 15, 2024

@thoop Thanks. Are there some one to write ASP.NET MVC client side? I think prerender is a great work. Because I like angular/ko stuff. If not one to write for ASP.NET MVC, I can write it.

from prerender.

thoop avatar thoop commented on June 15, 2024

@runxc1, were you going to write the ASP.NET MVC one? Or were you just requesting it?

from prerender.

borisrorsvort avatar borisrorsvort commented on June 15, 2024

Just want to signal some typo: its Yeoman and not Yeomon :)

from prerender.

thoop avatar thoop commented on June 15, 2024

@borisrorsvort Oops! Thanks for that.

from prerender.

runxc1 avatar runxc1 commented on June 15, 2024

I was more requesting it/seeing if there was one. I won't be able to get around to writing one for a few weeks.

from prerender.

thoop avatar thoop commented on June 15, 2024

Cool, thanks! @greengerong feel free to write an ASP .NET MVC one :)

from prerender.

greengerong avatar greengerong commented on June 15, 2024

@thoop thanks, I will finish it when i am free.

from prerender.

greengerong avatar greengerong commented on June 15, 2024

@thoop Prerender for asp.net mvc 4.0 https://github.com/greengerong/Prerender_asp_mvc . It almost done, I will clean some config and "read me", at next work.

Thanks

from prerender.

thoop avatar thoop commented on June 15, 2024

@greengerong Nice! I'll add it tonight. Thanks!

from prerender.

ysimonson avatar ysimonson commented on June 15, 2024

Here's a python decorator to get prerender working on tornado: http://tornadogists.org/7120798/

We're using it in production, although there might be bugs from e.g. missing imports since I plucked out the code.

from prerender.

greengerong avatar greengerong commented on June 15, 2024

@thoop Thanks

from prerender.

thoop avatar thoop commented on June 15, 2024

@ysimonson Awesome! I'll add that one tonight too. Thanks!

from prerender.

ysimonson avatar ysimonson commented on June 15, 2024

@thoop heads-up, the tornado link goes to the wrong place

from prerender.

thoop avatar thoop commented on June 15, 2024

Sorry, copy/paste fail. Fixed!

Thanks for letting me know.

from prerender.

ronenteva avatar ronenteva commented on June 15, 2024

Any workaround for sails.js?

from prerender.

thoop avatar thoop commented on June 15, 2024

@think-teva check out this StackOverflow answer: http://stackoverflow.com/questions/18548850/how-to-use-custom-route-middleware-with-sails-js-expressjs

The prerender-node middleware is built for ExpressJS (which sails.js uses) so it should be very close to being compatible.

Or check out the bottom of this doc for how they set up passport in sails.js: https://github.com/balderdashy/sails-docs/blob/0.9/policies.md

from prerender.

Jarlakxen avatar Jarlakxen commented on June 15, 2024

Hi! I just release a middleware for Scala Spray in Sonatype ( https://oss.sonatype.org/content/repositories/releases/com/github/jarlakxen/spray-prerender_2.10/ )

Repo: https://github.com/Jarlakxen/spray-prerender

from prerender.

thoop avatar thoop commented on June 15, 2024

@Jarlakxen Great! Thanks a lot. I added it to this card and I'll add it to our website and prerender repo asap.

from prerender.

mahonrig avatar mahonrig commented on June 15, 2024

Hello, I wrote a very simple middleware for the Slim PHP Framework ( http://www.slimframework.com ). I use pushState urls and not hash fragments, so the code for the escaped fragments could be wrong, didn't know how to check it. It correctly checks for bots using the user agent, and forwards those requests to Prerender.

repo: https://github.com/mahonrig/SlimPrerenderMiddleware

from prerender.

thoop avatar thoop commented on June 15, 2024

Thanks @mahonrig !

Yeah, it looks like it might not work for the hashbang. Check the source from zfr-prerender here for a great php implementation.

Let me know once you get that worked out.

from prerender.

mahonrig avatar mahonrig commented on June 15, 2024

@thoop Thanks for the link! I went back through, did some refactoring, added a bunch of ignored extensions (got them from your apache .htaccess). Works very well for my implementation at the least. It's still a lot simpler then the middleware for the larger frameworks, but Slim is supposed to be :)

from prerender.

thoop avatar thoop commented on June 15, 2024

@mahonrig great! I'll look at it tonight.

from prerender.

thoop avatar thoop commented on June 15, 2024

hey @ysimonson , looks like tornadogists let their domain expire: http://tornadogists.org/7120798/

Do you have that middleware code anywhere else so I can update the link? Thanks!

from prerender.

ysimonson avatar ysimonson commented on June 15, 2024

Yep, it's here: https://gist.github.com/ysimonson/7120798

from prerender.

jeroennoten avatar jeroennoten commented on June 15, 2024

I created support for Laravel: https://github.com/JeroenNoten/laravel-prerender
I am planning to add unit tests, support for gzip, and pre- and post- callbacks soon. If you have any suggestions, please let me know.

from prerender.

thoop avatar thoop commented on June 15, 2024

Thanks @jeroennoten!

from prerender.

lupomontero avatar lupomontero commented on June 15, 2024

Couldn't find a prerender hapi plugin, so ended up writing one:
https://github.com/wrangr/hapi-prerender

Feedback is welcome ;-)

Thanks for the awesome work!

from prerender.

thoop avatar thoop commented on June 15, 2024

@lupomontero You're awesome! Thanks so much. I'll add it there and to the website

from prerender.

lupomontero avatar lupomontero commented on June 15, 2024

@thoop Nice one!

from prerender.

timworld avatar timworld commented on June 15, 2024

Anything about IIS and Azure Websites integration ? Thanks Tim

from prerender.

talss89 avatar talss89 commented on June 15, 2024

@ronenteva - I have Sails 0.10 / Prerender working.

Here's my config/http.js file

module.exports.http = {
    middleware: {

     prerender: require('prerender-node'),
     order: [
       'startRequestTimer',
       'cookieParser',
       'session',
       'myRequestLogger',
       'bodyParser',
       'handleBodyParserError',
       'prerender',
       'compress',
       'methodOverride',
       'poweredBy',
       '$custom',
       'router',
       'www',
       'favicon',
       '404',
       '500'
     ]
  }
};

from prerender.

thoop avatar thoop commented on June 15, 2024

@talss89 nice! so prerender-node works with sails.js just fine then?

from prerender.

talss89 avatar talss89 commented on June 15, 2024

It certainly seems that way - we've only had it set up for a couple of hours on a dev instance. Google Webmaster Tools seems happy scraping our Angular / Sails / Prerender app though!

from prerender.

ronenteva avatar ronenteva commented on June 15, 2024

@talss89 Thanks,
I ended up adding a config/prerender.js file:

var locals = require('./local');

module.exports = {
    http: {
        customMiddleware: function (app) {
            app.use(require('prerender-node').set('prerenderToken', locals.prerenderio.token));
        }
    }
};

from prerender.

tampajohn avatar tampajohn commented on June 15, 2024

Thanks for the awesome work, I went ahead and created a golang middleware, feedback is welcome :).

from prerender.

sylido avatar sylido commented on June 15, 2024

Could we add IIS to the list ? Should be a simple rewrite from Apache ?

from prerender.

tjwebb avatar tjwebb commented on June 15, 2024

@talss89 Hey would you be interested in publishing a sails.js hook that integrates with prerender? We love to give shoutouts to community projects. Let me know, thanks.

-- sails.js team

from prerender.

jrapolu avatar jrapolu commented on June 15, 2024

Has anyone seen (or created) a middleware that works with Web API & IIS?

from prerender.

thoop avatar thoop commented on June 15, 2024

Some people have had success using this config with IIS:

https://gist.github.com/blowsie/04c183c62a432f6450c9

from prerender.

jrapolu avatar jrapolu commented on June 15, 2024

What are the steps to have own Prerender Server on Azure. My application is written in AngularJS, Web API and deployed in Azure.

from prerender.

luisbox avatar luisbox commented on June 15, 2024

VERY difficult to get prerender.io working in azure. It's ridiculous. Has anyone else been able to come up with anything better other than the link @thoop provided?

from prerender.

luisbox avatar luisbox commented on June 15, 2024

Okay, after trying a bunch of the code snippets with from the link @thoop originally provided, The last two comments is what worked. You should be able to do the same @jrapolu.

from prerender.

jrapolu avatar jrapolu commented on June 15, 2024

Thanks @luisbox. My prerender.io working with http://service.prerender.io in Azure. But I want to have my own prerender server deployed in azure. So that I can use for my website.

from prerender.

luisbox avatar luisbox commented on June 15, 2024

@jrapolu You can probably accomplish this using an Azure worker role (cloud service). I'd assume that once you set PhantomJS up within an azure worker role, you could use a similar web.config file and point to that service url, instead of prerender.io. Keep in mind that azure websites and web jobs can't run GDI+ which PhantomJS uses.

from prerender.

jrapolu avatar jrapolu commented on June 15, 2024

Thanks @luisbox for the info. I have tried with Azure worker role (cloud service). But No luck. Any working sample or steps to be followed will be very helpful.

from prerender.

thoop avatar thoop commented on June 15, 2024

Please keep discussion on this thread to middleware implementations. Create a new issue if you'd like to discuss running the Prerender server on Azure. Thanks!

from prerender.

jrapolu avatar jrapolu commented on June 15, 2024

Sure. Thank you.

Sent from my iPhone

On Dec 9, 2015, at 8:42 PM, Todd Hooper [email protected] wrote:

Please keep discussion on this thread to middleware implementations. Create a new issue if you'd like to discuss running the Prerender server on Azure. Thanks!

β€”
Reply to this email directly or view it on GitHub.

from prerender.

emanuil-tolev avatar emanuil-tolev commented on June 15, 2024

Ruby (Sinatra) and Ruby (Padrino) would be nice. I'll try with the Apache one now as the app is already using that in front of the framework itself anyway.

from prerender.

thoop avatar thoop commented on June 15, 2024

@emanuil-tolev Does Sinatra or Padrino use Rack middleware? That's what our gem uses so it should be interchangeable if things are set up correctly on our end.

from prerender.

thoop avatar thoop commented on June 15, 2024

@sivsushruth Thanks! I haven't heard of any demand yet for that framework.

from prerender.

emanuil-tolev avatar emanuil-tolev commented on June 15, 2024

Does Sinatra or Padrino use Rack middleware?

Yep, it uses Rack.

That's what our gem uses so it should be interchangeable if things are set up correctly on our end.

Excellent, though we've gone for the generic Apache one for now.

from prerender.

iamcz avatar iamcz commented on June 15, 2024

@sivsushruth was elixir/Phoenix support ever added?

from prerender.

mostafabarmshory avatar mostafabarmshory commented on June 15, 2024

Is there a document about Prerender.io?

I want to implement a custom middle-ware for a framework but it is not easy to understand how to send request to Prerender.io.

from prerender.

thoop avatar thoop commented on June 15, 2024

@mostafabarmshory the Prerender service API is pretty simple. Here's a short nginx config showing the basics: https://gist.github.com/thoop/8165802

The prerender-node middleware should be pretty easy to follow through the code to see the other features we built into that middleware... like whitelisting, etc

from prerender.

ggoyal2018 avatar ggoyal2018 commented on June 15, 2024

Hey @thoop which middle ware work with Angular 4.

from prerender.

thoop avatar thoop commented on June 15, 2024

@ggoyal2018 all of these middleware should work perfectly with Angular 4 depending on which server you are using! Let us know if you run into any issues at [email protected]

from prerender.

frankie567 avatar frankie567 commented on June 15, 2024

Hi @thoop!

First of all, thank you for Prerender! I just implemented it for our app, and it works nicely. For this, I implemented a Python middleware for Starlette/ASGI frameworks. I released it in open source, hoping it'll be of use for other developers out there: https://github.com/BeeMyDesk/prerender-python-starlette

Feel free to add it to the community middlewares list πŸ™‚

Cheers!

from prerender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.