Skip to content

iampaul83/paulclass-log-collect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

install

npm isntall

start

node index.js

post json

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

bad requests

// 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 file

每天各一個檔案

  • log/student.YYYYMMDD
  • log/teacher.YYYYMMDD

@TODO

  • create a new log file every day
  • test create a new log file every day

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published