koa-seo

SEO middleware for KOA is based on Chrome-Render instead of PRERender.

Modern web applications use techniques such as react.js vue. Js to render HTML in a browser, which makes it impossible for search engines to crawl your page content.

The project wants to solve such problems in a general way by detecting requests from search engine crawlers and then rendering your modern web page using headless Chrome and returning to the crawler.

This is the koA-SEO architecture diagram

Use

npm i koa-seo

Then use it;

const Koa = require('koa');
const seoMiddleware = require('koa-seo');
const app = new Koa();

app.use(seoMiddleware({
    render: {
        // use `window.isPageReady=1` to notify chrome-render page has ready
        useReady: true,}})); app.listen(3000);
Copy the code

Options

  • renderKoa – chrome – renderoptions

For a more flexible use case, see koa-Chrome-render.

This wave of learning down is a benefit……

Continue manual aite boss @Haolin