Skip to content

Actix middleware that sends crawler requests to Prerender.io or a custom Prerender service URL.

Notifications You must be signed in to change notification settings

saskenuba/actix-prerender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

actix-prerender

A simple middleware that sends HTTP requests from known crawlers user-agents to render as HTML by an external prerender service URL such as tvanro/prerender-alpine, or from the service from the creators prerender.io.

Useful to websites with tons of javascript, such as SPAs like Vue.js or React among others.

Usage

Prerender.io example

 use actix_prerender::Prerender;
 use actix_web::http::header;

 let token = "prerender service token".to_string();
 let prerender = Prerender::build().use_prerender_io(token);

 // `prerender` can now be used in `App::wrap`.

Custom service URL example

use actix_prerender::Prerender;
use actix_web::http::header;

let token = "prerender service token".to_string();
let prerender = Prerender::build().use_custom_prerender_url("https://localhost:5001");

// `prerender` can now be used in `App::wrap`.

Installation

Add this into your Cargo.toml

actix-prerender = "0.2"

About

Actix middleware that sends crawler requests to Prerender.io or a custom Prerender service URL.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages