Server and web for barcode scanner app
Connect at /session/connect
Connect to session
{
"type": "connect",
"session": "SESSION-ID"
}
Subscribes the client to all scans in session.
Scanned item
{
"type": "scan",
"session": "SESSION-ID",
"content": "SCAN-CONTENT"
}
Broadcasts scanned content to all clients connected to session. You don't have to be connected to the session to send a scan.
Scan
{
"scan": "SCAN-CONTENT"
}
Broadcasted scan content from a reader.
POST /session/create
Creates a session. No body is needed.
Is a json representation of the Session
object
{
"id": "SESSION-ID",
"clients": [
{
"connectedOn": "CONNECT-DATE",
"client": "WS-CLIENT"
}
],
"scanned": [
{
"value": "SCAN-VALUE",
"date": "SCAN-DATE"
}
]
}
GET session/:id
Gets the session.
Is a json representation of the Session
object
{
"id": "SESSION-ID",
"clients": [
{
"connectedOn": "CONNECT-DATE",
"client": "WS-CLIENT"
}
],
"scanned": [
{
"value": "SCAN-VALUE",
"date": "SCAN-DATE"
}
]
}
Means that the session does not exist