Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Latest commit

 

History

History
109 lines (76 loc) · 2.25 KB

server.md

File metadata and controls

109 lines (76 loc) · 2.25 KB

Geobin Server

The Geobin server hosts the Geobin web client as well as the API. It is written in go and uses redis so, assuming you have a working go dev environment and redis server running the following should get you up and running.

Setup

> go get github.com/esripdx/geobin.io
> cd $GOPATH/src/github.com/esripdx/geobin.io
> make setup # (runs `go get -t` and `npm install`)
> cp config.json.dist config.json

Configure

Geobin comes with a default config.json file which should get you up and running for development, you'll just need to copy config.json.dist to config.json (as listed in the Setup steps above).

Config Keys

  • Host The http host to listen on

    "Host": "localhost"
  • Port The http port to listen on

    "Port": 8080
  • RedisHost The redis host (with port)

    "RedisHost": "127.0.0.1:6379"
  • RedisPass The redis password

    "RedisPass": ""
  • RedisDB The redis db to connect to

    "RedisDB": 0
  • NameVals The set of valid characters to be used in the randomly generated binIDs.

    "NameVals": "023456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ"
  • NameLength The number of chars to be used in each binID.

    "NameLength": 10

Run

> make run

Test

> go test

Local Build

> go build -o geobin

Cross-compiled Build

This assumes you have set up the Go environment required to compile for your destination.

To produce a default tar.gz targeted at linux/amd64:

> make tar

If you want to build for a different OS and Arch:

> cd build/
> go run build.go -os myOS -arch myArch

As an example, to build for 32-bit windows:

> cd build/
> go run build.go -os windows -arch 386

The available OS and Arch combinations are listed at the blog linked above.