Polymer / prpl-server

⚠️Maintenance mode⚠️ An HTTP server for Node designed to serve PRPL apps in production.
Other
425 stars 29 forks source link

Allow configure Rendertron middleware when using CLI #83

Closed mskasal closed 3 years ago

mskasal commented 6 years ago

I would like to configure Rendertron when I am using CLI which using Rendertron middleware.

I believe these options quite important.

For instance, I want to skip image renderings sake of performance. I am able to do that when I use middleware like this;

app.use(rendertron.makeMiddleware({
    proxyUrl: args['bot-proxy'],
    injectShadyDom: true,
    excludeUrlPattern: new RegExp('png|jpeg', 'i') // --> I added this line in (https://github.com/Polymer/prpl-server/blob/1e66a56002b294a8121a6089735690b7c45580f4/src/cli.ts#L160)
}));

If I am missing something or there are a better options to achieve these please tell me. Thanks.

aomarks commented 3 years ago

I believe you would want to use the rendertron middleware directly for this use case: https://github.com/GoogleChrome/rendertron/tree/main/middleware

Apologies for the extremely slow response :)

Also please note that prpl-server is now in maintenance mode. Please see https://github.com/Polymer/prpl-server#prpl-server for our recently added maintenance mode notice, and recommendations for alternatives.