do-you-like-me

1.1.0 • Public • Published

Do you like me?

npm npm npm

Usage

Back-end

1. Use NodeJS + MongoDB

  • Install NodeJS 和 MongoDB
  • Upload back-end/nodejs/*
  • Run in nodejs:
$ npm install
$ nohup node index.js &
  • Change js/like.js
域名:8888/api/like?action=add
域名:8888/api/like?action=get
  • Enjoy it!

2. Use PHP + MySQL

  • Create a mysql table, run sql:
CREATE TABLE IF NOT EXISTS `votes` (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `likes` int(10) NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `votes` (`id`, `likes`) VALUES
(1, 0);

CREATE TABLE IF NOT EXISTS `votes_ip` (
    `id` int(10) NOT NULL AUTO_INCREMENT,
    `vid` int(10) NOT NULL,
    `ip` varchar(40) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  • Fill out database information in like.php
  • Upload like.php
  • Enjoy it!

Font-end

See demo

Demo

  1. Anotherhome右侧栏
  2. https://www.anotherhome.net/file/like/

LICENSE

MIT © DIYgod

Readme

Keywords

Package Sidebar

Install

npm i do-you-like-me

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • diygod