Skip to content

Commit c1942e4

Browse files
authored
Merge pull request #2 from Jogai/main
Add configurable server options (fixes #1)
2 parents cbc3371 + 965b970 commit c1942e4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ export SMTP_FROMNAME=
382382
export SMTP_MAILSPERSECOND=1
383383
```
384384
385+
**HTTP OPTIONS**
386+
```sh
387+
export LISTEN_PORT=5555
388+
export LISTEN_IP=0.0.0.0
389+
```
390+
385391
**SNS SECRET**
386392
```sh
387393
export SNS_WEBHOOK_SECRET=secret

nimletter.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import
44
std/[
55
exitprocs,
66
parseopt,
7+
strutils,
78
times
89
]
910

@@ -217,5 +218,4 @@ when isMainModule:
217218

218219
echo "\n=> nimletter up and running on port 5555\n"
219220

220-
server.serve(Port(5555))
221-
221+
server.serve(Port(parseInt(getEnv("LISTEN_PORT", "5555"))), address = getEnv("LISTEN_IP", "0.0.0.0"))

0 commit comments

Comments
 (0)