mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 20:31:13 +00:00
Set listen host and port with environment variables (#229)
* take host and port from environment * force Number for lint to pass
This commit is contained in:
parent
7430d3045c
commit
1f9a721a67
1 changed files with 4 additions and 3 deletions
|
@ -21,7 +21,8 @@ import { IncomingHttpHeaders } from "http";
|
||||||
import { setOptionalAuth } from "../shared/utils";
|
import { setOptionalAuth } from "../shared/utils";
|
||||||
|
|
||||||
const server = express();
|
const server = express();
|
||||||
const port = 1234;
|
const hostname = process.env['LEMMY_UI_HOST'] || 'localhost'
|
||||||
|
const port = process.env['LEMMY_UI_PORT'] || 1234;
|
||||||
|
|
||||||
server.use(express.json());
|
server.use(express.json());
|
||||||
server.use(express.urlencoded({ extended: false }));
|
server.use(express.urlencoded({ extended: false }));
|
||||||
|
@ -154,8 +155,8 @@ server.get("/*", async (req, res) => {
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen(port, () => {
|
server.listen(Number(port), hostname, () => {
|
||||||
console.log(`http://localhost:${port}`);
|
console.log(`http://${hostname}:${port}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
function setForwardedHeaders(
|
function setForwardedHeaders(
|
||||||
|
|
Loading…
Reference in a new issue