github.com/bcampbell/scrapeomat@v0.0.0-20220820232205-23e64141c89e/cmd/slurpserver/README.md (about) 1 # slurpserver 2 3 Provides an http API for serving up articles from a scrapeomat database. 4 5 With the -browse option, also supplies an html-based browse interface 6 for examining articles. 7 8 ## Commandline options: 9 10 -browse 11 enable html browsing of articles 12 -db string 13 database connection string (eg postgres://user:password@localhost/scrapeomat) or set $SCRAPEOMAT_DB 14 -port int 15 port to run server on (default 12345) 16 -prefix string 17 url prefix (eg "/ukarticles") to allow multiple servers on same port 18 -v int 19 verbosity (0=errors only, 1=info, 2=debug) 20 21 TODO document: 22 - running multiple slurpservers on same public port using nginx proxying 23 - web interface address (scheme://$HOST:$PORT/$PREFIX/browse) 24 - link to API document with JSON format explained 25 26 ## prerequisites 27 28 The web interface uses `go-bindata` to include `templates/` and `static/` 29 directly into the binary. So no extra files need to be installed for 30 deployment. 31 32 There are multiple forks of `go-bindata`, but kevinburke's one looks 33 like the one to pick. You can install it from source with: 34 35 $ go get -u github.com/kevinburke/go-bindata/... 36 37 38 ## building 39 40 $ go generate 41 $ go build 42 43 (the generate step creates `bindata.go` containing the extra files used by 44 the web interface) 45 46