没有合适的资源?快使用搜索试试~ 我知道了~
React 服务器端渲染支持 Fastify with Next
共18个文件
js:4个
json:3个
yml:3个
需积分: 9 0 下载量 69 浏览量
2021-06-08
16:38:31
上传
评论
收藏 81KB ZIP 举报
温馨提示
fastify-nextjs React 服务器端渲染支持 Fastify with Next Framework。 安装 npm i fastify-nextjs next react react-dom --save 用法由于 Next 在第一次启动时需要一些时间来准备好,您必须在注册插件后在 after 回调中声明您的路由。 该插件将在 Fastify 中公开 api,它将为您处理渲染。 const fastify = require('fastify')() fastify .register(require('fastify-nextjs')) .after(() => { fastify.next('/hello') }) fastify.listen(3000, err => { if (err) throw err console.log('Server listener on http://localhost:3000') }) 所有服务器呈现的页面都必须保存在文件夹页面中,您可以在下一个文档中看到。 // /pages/hello.js 导出默认值 () =>
资源推荐
资源详情
资源评论
收起资源包目录
fastify-nextjs-master.zip (18个子文件)
fastify-nextjs-master
pages
hello.jsx 44B
api
user.js 156B
.github
stale.yml 772B
dependabot.yml 261B
workflows
ci.yml 833B
.taprc 52B
types.test.ts 665B
example.js 256B
test.js 12KB
tsconfig.json 599B
LICENSE 1KB
README.md 4KB
index.d.ts 1KB
.npmrc 18B
.gitignore 2KB
index.js 3KB
package-lock.json 276KB
package.json 2KB
共 18 条
- 1
资源评论
小马甲不小
- 粉丝: 22
- 资源: 4714
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功