@cc4pm/homepage
v1.0.5
Published
cc4pm 官网首页 — 可嵌入其他网站的独立 HTML 页面
Maintainers
Readme
@cc4pm/homepage
cc4pm 官网首页,可嵌入其他网站使用。
安装
npm install @cc4pm/homepage使用
Express
const { filePath } = require('@cc4pm/homepage');
app.get('/cc4pm', (req, res) => res.sendFile(filePath));Next.js
import homepage from '@cc4pm/homepage';
export async function getStaticProps() {
return { props: { html: homepage.html() } };
}
export default function CC4PM({ html }) {
return <div dangerouslySetInnerHTML={{ __html: html }} />;
}复制到 public 目录
cp node_modules/@cc4pm/homepage/index.html public/cc4pm.htmlAPI
filePath— HTML 文件的绝对路径html()— 返回 HTML 字符串
