[ EBS - Twitch Extension ] How host backend in public?

Hello, i want to host the backend of my twitch extension but when i start backend.js i have

(node:18740) UnhandledPromiseRejectionWarning: Error: listen EADDRNOTAVAIL: address not available MY-PUBLIC-IP:8000
at Server.setupListenHandle [as _listen2] (net.js:1260:19)
at listenInCluster (net.js:1325:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1458:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:62:10)
(node:18740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:18740) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I do some search and i see the modul “Hapi” can’t be use in public, only in local.
So how can i do for host my backend ?

(Sorry for my bad english i’m french) Merci

Hapi is used in the example, but generally speaking most people tend to use Express instead.

Either way you’d usually put Hapi (or express) behind Nginx or other HTTP proxy, as it’s generally safer and easier to handle static elements such as images/css, and better for logging, and also easier to manage SSL certificates.

So you can use HAPI, as you have, but you’ll need to be putting this code on a Web Accessible server provided by a server provider, or look at other solutions such a AWS services/Cloud provider.

And of course you don’t have to use Node at all

Thanks for you’re answer

1 Like