Skip to content
Snippets Groups Projects
Commit 008bb466 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[enh] Use configuration for API network listening

parent ab9a5d98
Branches
Tags
No related merge requests found
...@@ -69,7 +69,13 @@ Duniter.run([{ ...@@ -69,7 +69,13 @@ Duniter.run([{
':gva:' + conf.pair.pub.substr(0, 6)) ':gva:' + conf.pair.pub.substr(0, 6))
return { return {
startService: async () => { startService: async () => {
if (!conf.gva || conf.gva.upnp) { if (conf.gva) {
// Static usage of port + host, no UPnP
app = gvaHttpListen(server,
conf.gva.port || DEFAULT_GVA_PORT,
conf.gva.host || 'localhost')
}
else if (!conf.gva || conf.gva.upnp) {
// Using UPnP // Using UPnP
const { available, host, port } = await api.startRegular() const { available, host, port } = await api.startRegular()
if (available) { if (available) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment