allow custom port for API server (#204)
* allow custom port for API server * add .editorconfig
This commit is contained in:
parent
5db8873807
commit
134eb654d2
6 changed files with 23 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
# esmBot Image API
|
||||
The esmBot image API is a combined HTTP and WebSocket API running on port 3762. The API supports very basic authentication, which is defined on the server via the PASS environment variable and is sent from the client via the Authentication header in both HTTP and WS requests.
|
||||
The esmBot image API is a combined HTTP and WebSocket API. 3762 is the default port to access the API. The API supports very basic authentication, which is defined on the server via the PASS environment variable and is sent from the client via the Authentication header in both HTTP and WS requests.
|
||||
|
||||
## HTTP
|
||||
|
||||
|
@ -45,4 +45,4 @@ The job object is formatted like this:
|
|||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
|
|
@ -230,8 +230,8 @@ httpServer.on("upgrade", (req, sock, head) => {
|
|||
httpServer.on("error", (e) => {
|
||||
console.error("An HTTP error occurred: ", e);
|
||||
});
|
||||
|
||||
httpServer.listen(3762, () => {
|
||||
const port = parseInt(process.env.PORT) || 3762;
|
||||
httpServer.listen(port, () => {
|
||||
log("HTTP and WS listening on port 3762");
|
||||
});
|
||||
|
||||
|
@ -269,4 +269,4 @@ const runJob = (job, ws) => {
|
|||
reject(e);
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue