comments
1.0.0
实时评论引擎,支持匿名或经过身份验证的帖子
mkdir -p target/standalone && cd target/standalone
wget https://cdn.jsdelivr.net/npm/[email protected]/bin/comments-linux-standalone-x64.tar.gz
tar -xzf comments-linux-standalone-x64.tar.gz
./start.sh
该演示在位于 SG 的 2.5 美元 vultr 计划上运行,该应用程序配置为使用最大内存 128mb(将大部分可用内存留给文件系统缓存)。
将其放在 html 正文中的任何位置(尽管建议将其放在最后)
< div id =" comments " > </ div >
< script >
window . comments_config = {
collapse_depth : 7 , // the depth where comments get collapsed by default
limit_depth : 10 , // max: 127
//auth_host: 'https://api.dyuproject.com', // if you prefer authenticated comments
ws_enabled : true , // real-time updates
ws_host : 'wss://rpc.dyuproject.com/sub' ,
rpc_host : 'https://rpc.dyuproject.com'
}
</ script >
< script src =" https://netlify-comments.dyuproject.com/dist/build.js " > </ script >
< link rel =" stylesheet " href =" https://netlify-comments.dyuproject.com/dist/build.css " />
注意:使用相同的实例为演示提供支持。没有任何跟踪。
mkdir -p target/data/main
echo " Your data lives in user/ dir. Feel free to back it up. " > target/data/main/README.txt
# download protostuffdb
yarn add [email protected] && mv node_modules/protostuffdb/dist/ * target/ && rm -f package.json yarn.lock && rm -r node_modules
wget -O target/fbsgen-ds.jar https://repo1.maven.org/maven2/com/dyuproject/fbsgen/ds/fbsgen-ds-fatjar/1.0.10/fbsgen-ds-fatjar-1.0.10.jar
./modules/codegen.sh
mvn install
npm install -g http-server clean-css-cli
cd comments-ts
yarn install
# produces a single jar the first time (comments-all/target/comments-all-jarjar.jar)
./run.sh
# on another terminal
cd comments-ts
# serves the ui via http://localhost:8080/
yarn run dev
如果您的开发机器是 MacOS, protostuffdb目前没有适用于它的二进制发行版(没有可供测试/构建的 MacOS 机器)。
另一方面,您仍然可以使用此临时解决方法在客户端部分进行开发:
comments-ts/index.html
window.rpc_host = 'http://127.0.0.1:5020'
替换为window.rpc_host = 'https://rpc.dyuproject.com'
cd comments-ts
# produces a single js and other assets in comments-ts/dist/
yarn run build