1
0
mirror of https://github.com/taigrr/shorturl synced 2025-01-18 04:03:16 -08:00

Remove fqdn config (not needed at this time)

This commit is contained in:
James Mills 2017-07-03 00:06:36 -07:00
parent 3380bc5e65
commit 8ff215fdb6
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
4 changed files with 1 additions and 14 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
shorturl

View File

@ -2,5 +2,4 @@ package main
// Config ...
type Config struct {
FQDN string
}

View File

@ -10,12 +10,4 @@ func TestZeroConfig(t *testing.T) {
assert := assert.New(t)
cfg := Config{}
assert.Equal(cfg.FQDN, "")
}
func TestConfig(t *testing.T) {
assert := assert.New(t)
cfg := Config{FQDN: "bar.com"}
assert.Equal(cfg.FQDN, "bar.com")
}

View File

@ -17,18 +17,13 @@ func main() {
config string
dbpath string
bind string
fqdn string
)
flag.StringVar(&config, "config", "", "config file")
flag.StringVar(&dbpath, "dbpth", "urls.db", "Database path")
flag.StringVar(&bind, "bind", "0.0.0.0:8000", "[int]:<port> to bind to")
flag.StringVar(&fqdn, "fqdn", "localhost", "FQDN for public access")
flag.Parse()
// TODO: Abstract the Config and Handlers better
cfg.FQDN = fqdn
var err error
db, err = bolt.Open(dbpath, 0600, nil)
if err != nil {