# pp-fishssr

> fish ssr

Latest version **1.0.1** (published 2019-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install pp-fishssr
pnpm add pp-fishssr
yarn add pp-fishssr
bun add pp-fishssr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-12-17 |
| First published | 2019-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 6 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | guozhenyong |
| Maintainers | hepeguo |
| Keywords | egg, eggPlugin, egg-plugin |

## Links

- npm: https://www.npmjs.com/package/pp-fishssr
- npm.io page: https://npm.io/package/pp-fishssr

## Dependencies (6)

- [egg](https://npm.io/package/egg.md) ^2.26.0
- [react](https://npm.io/package/react.md) ^16.12.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.12.0
- [egg-scripts](https://npm.io/package/egg-scripts.md) ^2.12.0
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^5.1.2
- [serialize-javascript](https://npm.io/package/serialize-javascript.md) ^2.1.2

## Recent versions

- 1.0.1 (latest) — 2019-12-17
- 1.0.0 — 2019-12-17

## README

# 关于ssr[服务端渲染插件]
- 插件fishssr会给ctx增加 ctx.fishssr.renderPage 方法

```
  await ctx.fishssr.renderPage(initialData);
```
类似调用ctx.render()

- fishssr 读取config.fishssr，

```
enable: false 关闭服务端渲染，默认是true打开状态
routes: 路由，单个路由中包括 controller：node端处理函数，Component：前端页面入口组件，route可重载下面三个属性，即单个页面可定制渲染模版，渲染入口组件，渲染时传入的数据
template：公共模版
serverJs：服务端版本页面组件
locals：传入模版的数据，可根据自定义模版自由传递数据
```
- config.fishssr.routes 需手动在route中配置

```
const { router } = app;
app.config.fishssr.routes.map(route => {
  router.get(`${route.path}`, `${route.controller}`)
});
```
生成服务端路由

---
_Source: https://npm.io/package/pp-fishssr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
