NodeJS server for RFID attendance system wiattend. Server uses MySQL database management system.
Run next commands for install dependencies and start the server
npm i
npm start
All routes returns response in JSON
format.
-
GET /logs
Returns
Last 20 logs from database.
-
GET /tags
Returns
All tags from database.
-
POST /log
Accept
This route requires next HTTP headers:
Header name Header value sguid
2ce81521-c42f-4556-8c28-c69d7e3a3a47 rfid-tag
Serial number of tag Returns
Logged tag.
All messages broadcasted to clients are formated in JSON
style.
{
"event": "event_name",
"data": {}
}
-
logged
Data of event
logged
represents logged tag. Ifnext_direction
proprety of logged tag is-1
that means the user of tag is now present, otherwise (if it is1
) user is absent."event": "logged", "data": { "id": 3, "uid": "0x79 0x09 0x08 0x85 0xFD", "first_name": "Nikola", "last_name": "Tesla", "next_direction": 1 }