-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.rkt
More file actions
27 lines (24 loc) · 998 Bytes
/
Copy pathmain.rkt
File metadata and controls
27 lines (24 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#lang racket/base
(require "syndicate-sandbox/server.rkt"
racket/cmdline)
(define serve-host (make-parameter (or (getenv "RKT_HOST") "127.0.0.1")))
(define serve-port (make-parameter (let ([p (getenv "RKT_PORT")])
(if p
(string->number p)
4001))))
(module+ main
(command-line
#:once-each
[("-l") "listen on all IP addresses"
(serve-host #f)]
[("--host") h "specify the host IP addr of the server"
(serve-host h)]
[("-p" "--port") p "specify the port of the server"
(serve-port (string->number p))]
[("--phx-host") ph "Specify the hostname of the phoenix server"
(phx-host ph)]
[("--phx-port") pp "Specify the port number for the phoenix server"
(phx-port (string->number pp))]
#:args ()
(run-server #:port (serve-port)
#:host (serve-host))))