Konfigurovatelný host

This commit is contained in:
2026-05-31 11:28:40 +02:00
parent 6c6cc4a88b
commit e4e2ba7508
3 changed files with 4 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import { read } from "read";
const SANE_DEFAULTS: Config = {
server: {
host: "127.0.0.1",
port: 3000,
postgres: "postgresql://user:password@localhost:5432/czchan",
redis: "redis://localhost:6379/0",

View File

@@ -7,6 +7,7 @@ import { readFile, writeFile } from "fs/promises";
type CzchanConfig = {
site: {
server: {
host: string,
port: number;
postgres: string;
redis: string;

View File

@@ -88,12 +88,12 @@ const main = async () => {
pruneFiles,
);
app.listen(startupConfig.site.server.port, () => {
app.listen(startupConfig.site.server.port, startupConfig.site.server.host, () => {
// Best we can do with a sync callback
void czchanLog(
"server",
"info",
`Server spuštěn: http://localhost:${startupConfig.site.server.port}`,
`Server spuštěn: http://${startupConfig.site.server.host}:${startupConfig.site.server.port}`,
);
});
};