make using CORS configurable by environment var, defaults to false

This commit is contained in:
dhax 2019-03-09 14:42:08 +01:00
parent bc565a4008
commit 9f75bf6a5d
4 changed files with 7 additions and 4 deletions

View file

@ -19,7 +19,7 @@ type Server struct {
// NewServer creates and configures an APIServer serving all application routes.
func NewServer() (*Server, error) {
log.Println("configuring server...")
api, err := New()
api, err := New(viper.GetBool("enable_cors"))
if err != nil {
return nil, err
}