Konfigurovatelný host
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -7,6 +7,7 @@ import { readFile, writeFile } from "fs/promises";
|
||||
type CzchanConfig = {
|
||||
site: {
|
||||
server: {
|
||||
host: string,
|
||||
port: number;
|
||||
postgres: string;
|
||||
redis: string;
|
||||
|
||||
@@ -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}`,
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user