Skip to content

wayou/node-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa + mysql todo app

sample project to demonstrate the crud operations.

prerequirments

you need mysql installed and setup a appropriate user to run the demo.

mysql quick reference

installing:

$ brew install mysql

start mysql service:

$ brew services start mysql

login as root and add a user:

$ mysql -uroot
mysql> create user '<username>'@'localhost' identified with mysql_native_password by '<pswd>'

then fill the <username> and pswd into config.js

login as the new created user and create corresponding database and tables.

mysql> quit
$ mysql -u <username> -p
Enter password: ***
mysql> create database todo
mysql> use todo;

execute the following script to create the todo table:

CREATE TABLE `todo` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `content` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `is_done` int(11) DEFAULT '0',
  `date` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci

installing

$ yarn

running

$ yarn start
server started at http://localhost:3000

then visit http://localhost:3000.

About

Node.js + Koa + MySQL CRUD example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published