Create WebServer with Plugin API
Hello !
I read the doc for install a webserver in my bot.
Here my code:
These lines should open a web server on 8080 port, no ?
9 Replies
Assuming you have the line to register the api plugin somewhere, yes.
You need to have this somewhere in your entrypoint. And add the dependency of course.
Yes I have
Then yes there should be a web server. There is no default route other than
/oauth/login
though so if you were testing with /
you'd get 404I get
ERR_CONNECTION_REFUSED
My web server is not " open "Solution
OK, that's it.
He didn't like port 8080
maybe something else was already running on it
btw those options you have there is invalid. It should be nested under an
api
key:
also prefix: ''
and origin: '*'
are the defaultThank you!
For further clarification, the port 8080 is also the HTTP default port (:80/:8080, HTTPS is :443). This is also the port used by Nginx or Apache which come pre-installed in many servers, so naturally because that port is used, it fails.
The idea with Nginx or Apache is that you can use them as a reverse proxy instead of exposing those ports directly, which comes with many benefits, but that's a more complex topic (and unrelated to this, but you can ask in #off-topic!)