source: code/trunk/config/config.go@ 139

Last change on this file since 139 was 132, checked in by asciimoo, 5 years ago

Merge pull request #76 from dalf/redirect

[mod] follow HTTP redirect (only GET HTTP method)

File size: 615 bytes
RevLine 
[127]1package config
2
3import (
4 "os"
5)
6
7type Config struct {
8 Debug bool
9 ListenAddress string
10 Key string
11 IPV6 bool
12 RequestTimeout uint
[131]13 FollowRedirect bool
[127]14}
15
16var DefaultConfig *Config
17
18func init() {
19 default_listen_addr := os.Getenv("MORTY_ADDRESS")
20 if default_listen_addr == "" {
21 default_listen_addr = "127.0.0.1:3000"
22 }
23 default_key := os.Getenv("MORTY_KEY")
24 DefaultConfig = &Config{
25 Debug: os.Getenv("DEBUG") != "false",
26 ListenAddress: default_listen_addr,
27 Key: default_key,
28 IPV6: true,
29 RequestTimeout: 5,
[131]30 FollowRedirect: false,
[127]31 }
32}
Note: See TracBrowser for help on using the repository browser.