Author: smhan@dbserver.kaist.ac.kr
This is a prototype code for new starters who will build their application based on
- Node.js + Express.js
- MySQL community version
- (optional) JQuery
First run the run_on_my.sql on mysql manually, or simply by
$ sudo mysql < run_on_my.sql
This will create database called cs360_tutorial and create table called user_tbl while creating new user called 'tester'@'localhost' with password '1234'.
Then, install the node modules:
$ npm install
Now, run the server.
$ node app.js
Example app listening on port 3000!
Checkout your http://localhost:3000/.
- localhost:3000/: sends "index.html" which includes submit form.
- localhost:3000/listAPI: sends raw json format data from "select * from user_tbl"
- localhost:3000/listPretty: give into list using JQuery ajax. check javascript code.