aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/port/main.go
blob: 6cdccc64851b5ad926da0759e965965703446e44 (plain) (blame)
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
package main

import (
	"flag"
	"log"

	port "git.vulpes.one/Feuerfuchs/port/internal/port"
)

var (
	// TODO: Allow config file and environment vars
	//       (opt -> env -> config -> default)
	bind            = flag.String("bind", "0.0.0.0:8000", "[int]:port to bind to")
	startpagefile   = flag.String("startpage-file", "startpage.txt", "Default page to display if no URL is specified")
	robotsfile      = flag.String("robots-file", "robots.txt", "robots.txt file")
	robotsdebug     = flag.Bool("robots-debug", false, "print output about ignored robots.txt")
	vipsconcurrency = flag.Int("vips-concurrency", 1, "Concurrency level of libvips")
)

func main() {
	flag.Parse()

	// Use a config struct
	log.Fatal(port.ListenAndServe(*bind, *startpagefile, *robotsfile, *robotsdebug, *vipsconcurrency))
}