Skip to content

Commit

Permalink
Update constants.js
Browse files Browse the repository at this point in the history
Add support for hostname/interfaces in Deno.
  • Loading branch information
coreybutler authored Jan 31, 2022
1 parent 069c41d commit 7b1ff09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ if (NGN.runtime === 'node') {
}
}
})()
} else if (NGN.runtime === 'deno') {
if (Deno?.hostname) {
HOSTNAME = Deno.hostname()
}
if (Deno?.networkInterfaces) {
for (const {address} of Deno.networkInterfaces()) {
interfaces.add(address)
}
}
}

export { HOSTNAME }
Expand Down

0 comments on commit 7b1ff09

Please sign in to comment.