Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gwuhaolin/koa-seo
koa SEO middleware
https://github.com/gwuhaolin/koa-seo
chrome koa middleware seo server-rendering
Last synced: 2 months ago
JSON representation
koa SEO middleware
- Host: GitHub
- URL: https://github.com/gwuhaolin/koa-seo
- Owner: gwuhaolin
- Created: 2017-06-09T11:51:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-13T02:37:07.000Z (about 7 years ago)
- Last Synced: 2024-11-02T03:22:52.851Z (3 months ago)
- Topics: chrome, koa, middleware, seo, server-rendering
- Language: JavaScript
- Homepage:
- Size: 69.3 KB
- Stars: 36
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Npm Package](https://img.shields.io/npm/v/koa-seo.svg?style=flat-square)](https://www.npmjs.com/package/koa-seo)
[![Build Status](https://img.shields.io/travis/gwuhaolin/koa-seo.svg?style=flat-square)](https://travis-ci.org/gwuhaolin/koa-seo)
[![Npm Downloads](http://img.shields.io/npm/dm/koa-seo.svg?style=flat-square)](https://www.npmjs.com/package/koa-seo)
[![Dependency Status](https://david-dm.org/gwuhaolin/koa-seo.svg?style=flat-square)](https://npmjs.org/package/koa-seo)# koa-seo
SEO middleware for koa base on [chrome-render](https://github.com/gwuhaolin/chrome-render), a substitute for [prerender](https://prerender.io).Modern web app use technique like react.js vue.js which render html in browser, this lead to search engine can't crawl your page content.
This project want to solve this kind of problem in a general-purpose way, it detect request is from search engine crawler then use headless chrome to render out your modern web page and return to crawler.
Here is koa-seo's architecture diagram:
![koa-seo arch](./doc/koa-seo%20arch.png)## Use
```bash
npm i koa-seo
```
then use it:
```js
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);
```
you can download and run this [complete demo](test/server.js)## Options
- `render` options from [koa-chrome-render](https://github.com/gwuhaolin/koa-chrome-render#render-options)For more flexible use case see [koa-chrome-render](https://github.com/gwuhaolin/koa-chrome-render).
## Friends
- koa-seo dependent on [koa-chrome-render](https://github.com/gwuhaolin/koa-chrome-render) chrome-render middleware for koa.
- [chrome-render](https://github.com/gwuhaolin/chrome-render) general server render base on chrome.
- [chrome-pool](https://github.com/gwuhaolin/chrome-pool) Headless chrome tabs manage pool.
- [express-middleware-seo](https://github.com/Binaryify/express-middleware-seo) SEO middleware for express base on [chrome-render](https://github.com/gwuhaolin/chrome-render)