npm isntall
node index.js
curl -H "Content-Type: application/json" -X POST -d '{"iam":"paul83"}' http://localhost:3000/student
curl -H "Content-Type: application/json" -X POST -d '{"iam":"hanqqq.com"}' http://localhost:3000/teacher
// no "Content-Type: application/json" header(可以透過bodyParser.json設定允許)
curl -X POST -d '{"iam":"paul83"}' http://localhost:3000/student
// only POST method is accepted
curl -H "Content-Type: application/json" -X GET -d '{"iam":"paul83"}' http://localhost:3000/student
// bad json
curl -H "Content-Type: application/json" -X POST -d '{"iam":"paul83"QQ}' http://localhost:3000/student
每天各一個檔案
- log/student.YYYYMMDD
- log/teacher.YYYYMMDD
create a new log file every day- test create a new log file every day