GiServerless & Beautiful 基于 leancloud 的三方评论系统

栏目: IT技术 · 发布时间: 6年前

内容简介:Serverless & Beautiful third-part comment system base on lean cloud. 简洁有趣、无需后端代码的三方评论系统。

clz

Serverless & Beautiful third-part comment system base on lean cloud. 简洁有趣、无需后端代码的三方评论系统。

Live Demo 1 | Live Demo 2

Install

$ npm i --save clz

Usage

import CLZ from 'clz';

// 注意换成你自己的,去 leancloud 免费创建即可获取
const c = new CLZ({
  appId: 'KO2rVJq8lMvgaYkEMhrUxgGn-gzGzoHsz',
  appKey: '3UEp42VPz1kc731PeKDYKY7Q',
  serverURLs: 'https://ko2rvjq8.lc-cn-n1-shared.com',
  page: 'clz',
});

// 处理当前页面
c.launch();

// or update 
c.clear();

c.updatePage('your page key'); // default is `pathname`.

c.launch();

Option

  • appId :leancloud 应用的 appId;
  • appKey :leancloud 应用的 appKey;
  • serverURLs :leancloud 应用的 serverURLs;
  • page :页面唯一标识,默认是根据 url 中的 pathname 标识;
  • clicks :触发评论的点击次数,默认是 2 ,也就是双击;
  • interval :连续点击的间隔时间,默认为 200 毫秒;

Apply

在 leancloud 中注册账号,然后申请免费应用,即可获得对应的 appIdappKeyserverURLs 可使用提供的共享地址,不过最好绑定二级域名,使用自己的域名地址。

  1. 进入 leancloud 控制台,创建应用(免费的即够用)
  2. 在应用设置 - 应用 Keys 页面
  3. 复制 appIdappKeyserverURLs 作为程序的配置
  4. 你也可以在存储管理中,去管理所有的评论

License

MIT@ hustcc .


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Defensive Design for the Web

Defensive Design for the Web

37signals、Matthew Linderman、Jason Fried / New Riders / 2004-3-2 / GBP 18.99

Let's admit it: Things will go wrong online. No matter how carefully you design a site, no matter how much testing you do, customers still encounter problems. So how do you handle these inevitable bre......一起来看看 《Defensive Design for the Web》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具