()
| 3 | |
| 4 | /** Returns the machine's LAN IPv4 address so phones on the same network can connect. */ |
| 5 | export async function GET() { |
| 6 | const nets = networkInterfaces(); |
| 7 | for (const name of Object.keys(nets)) { |
| 8 | for (const net of nets[name] ?? []) { |
| 9 | if (!net.internal && net.family === "IPv4") { |
| 10 | return NextResponse.json({ ip: net.address }); |
| 11 | } |
| 12 | } |
| 13 | } |
| 14 | return NextResponse.json({ ip: null }); |
| 15 | } |
nothing calls this directly
no outgoing calls
no test coverage detected