Skip to content

Commit

Permalink
Fix environment checking for proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
NavidK0 committed Oct 16, 2020
1 parent 1da2c26 commit 60cf87b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,23 @@ async function initProxy(connection, port) {
}
});

proxy.register(environment === 'development' ? 'singlelink.localhost' : config.apiDomain, "127.0.0.1:4444", {
ssl: {
key: "./localcert/singlelink.localhost.key",
cert: "./localcert/singlelink.localhost.crt",
}
});
if (environment === 'development') {
proxy.register('singlelink.localhost', "127.0.0.1:4444", {
ssl: {
key: "./localcert/singlelink.localhost.key",
cert: "./localcert/singlelink.localhost.crt",
}
});
} else {
proxy.register(config.apiDomain, "127.0.0.1:4444", {
ssl: {
letsencrypt: {
email: 'letsencrypt@neutroncreative.com', // Domain owner/admin email
production: config.production, // WARNING: Only use this flag when the proxy is verified to work correctly to avoid being banned!
}
}
});
}

proxy.register("localhost", "127.0.0.1:4444", {
ssl: {
Expand Down

0 comments on commit 60cf87b

Please sign in to comment.