mirror of
https://github.com/Sean-Der/fail2rest.git
synced 2024-12-22 13:42:17 +01:00
Revert "Updating file path location search for config.json"
This reverts commit c5a2d036d7
.
This commit was reverted since it breaks 'go run *.go', I plan on
bringing back custom config.json location with a switch instead.
This commit is contained in:
parent
be624ce771
commit
598eea73e3
1 changed files with 1 additions and 6 deletions
|
@ -3,7 +3,6 @@ package main
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"path"
|
|
||||||
"github.com/Sean-Der/fail2go"
|
"github.com/Sean-Der/fail2go"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -22,11 +21,7 @@ type ErrorBody struct {
|
||||||
var fail2goConn *fail2go.Conn
|
var fail2goConn *fail2go.Conn
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
file, fileErr := os.Open("config.json")
|
||||||
//Changing path of current running directory to path of running executable for finding the config.json file.
|
|
||||||
//This will allow the creation of a linux service to run fail2rest (ie: service fail2rest start/stop/status)
|
|
||||||
var filePath string = path.Dir(os.Args[0])
|
|
||||||
file, fileErr := os.Open(filePath + "/config.json")
|
|
||||||
|
|
||||||
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