mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 13:42:17 +01:00
config.json path can now be specified with the --config flag
This commit is contained in:
parent
a49b9b67de
commit
f3fe29f69b
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/Sean-Der/fail2go"
|
"github.com/Sean-Der/fail2go"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
@ -21,7 +22,10 @@ type ErrorBody struct {
|
||||||
var fail2goConn *fail2go.Conn
|
var fail2goConn *fail2go.Conn
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
file, fileErr := os.Open("config.json")
|
configPath := flag.String("config", "config.json", "path to config.json")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
file, fileErr := os.Open(*configPath)
|
||||||
|
|
||||||
if fileErr != nil {
|
if fileErr != nil {
|
||||||
fmt.Println("failed to open config:", fileErr)
|
fmt.Println("failed to open config:", fileErr)
|
||||||
|
|
Loading…
Reference in a new issue