【文件属性】:
文件名称:koa-seo:koa SEO中间件
文件大小:46KB
文件格式:ZIP
更新时间:2021-01-31 05:18:36
middleware chrome koa seo server-rendering
高雪
koa的SEO中间件基于替代 。
现代网络应用程序使用诸如react.js vue.js之类的技术在浏览器中呈现html,这导致搜索引擎无法抓取您的页面内容。
该项目想要以通用的方式解决此类问题,它检测到来自搜索引擎爬虫的请求,然后使用无头chrome渲染出您的现代网页并返回到爬虫。
这是koa-seo的架构图:
利用
npm i koa-seo
然后使用它:
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 ) ;
您可以下载并运行此
选件
从 rend
【文件预览】:
koa-seo-master
----.travis.yml(184B)
----index.js(1KB)
----package.json(619B)
----test()
--------server.js(918B)
--------index.test.js(1KB)
----doc()
--------koa-seo arch.png(43KB)
----.gitignore(94B)
----README.md(2KB)
----.editorconfig(167B)