A LAN device discovery app. Basically a NestJS wrapper around arp with simple REST apis and event emitters.
Get devices.
?online=
: boolean?macAddress_in=
: String array separated by,
. e.g.61:d7:3d:c4:4d:95,db:73:5f:13:14:05
- Status: 200
- Content-Type: "application/json"
[
{
"macAddress": "61:d7:3d:c4:4d:95",
"name": null,
"ip": "192.168.1.2",
"online": true,
},
{
"macAddress": "db:73:5f:13:14:05",
"name": null,
"ip": "192.168.1.3",
"online": false,
},
]
Patch the name of device.
- Content-Type: "application/json"
{
"name": "My new iPhone",
}
- Status: 200
- Content-Type: "application/json"
{
"macAddress": "61:d7:3d:c4:4d:95",
"name": "My new iPhone",
"ip": "192.168.1.2",
"online": true,
}
This app provides 2 types of event:
Device Connect
: Triggers when device connects to the network.Device Disconnect
: Triggers when device disconnects from the network.
You can overwrite the listener functions with custom event handler logic here. The event payload represents single device in the format of:
{
"macAddress": "61:d7:3d:c4:4d:95",
"name": "My new iPhone",
"ip": "192.168.1.2",
"online": true,
}