koa demo project
> yarn
> node app.js
DROP TABLE IF EXISTS `sm_user`;
CREATE TABLE `sm_user` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`uname` varchar(100) DEFAULT NULL,
`addtime` datetime DEFAULT NULL,
`isdel` int(1) DEFAULT NULL,
PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;;
SET FOREIGN_KEY_CHECKS = 1;
config file path './configs/mysql_config.json'
{
"host": "localhost",
"port": 3306,
"user": "root",
"password": "123456",
"database": "mydb",
"charset": "UTF8_GENERAL_CI",
"dateStrings": true
}
config file path './configs/redis_config.json'
{
"port": 6379,
"host": "127.0.0.1",
"db": 0
}
other config
{
port: 6379, // Redis port
host: '127.0.0.1', // Redis host
family: 4, // 4 (IPv4) or 6 (IPv6)
password: 'auth',
db: 0
}
this is a mysql helper simple plug-in