Skip to content

Commit

Permalink
Invocation par now allows to define the listener port
Browse files Browse the repository at this point in the history
  • Loading branch information
framps committed Oct 26, 2017
1 parent 69d8ab6 commit 662c07f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Binary file modified RESTAPI/bin/raspiBackupRESTListener
Binary file not shown.
7 changes: 6 additions & 1 deletion RESTAPI/raspiBackupRESTListener.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ package main
*/

import (
"flag"
"fmt"
"io/ioutil"
"log"
Expand Down Expand Up @@ -102,6 +103,9 @@ func main() {
gin.SetMode(gin.ReleaseMode)
api := gin.Default()

listenAddress := flag.String("a", ":8080", "Listen address of server. Default: :8080")
flag.Parse()

var passwordSet bool
var credentialMap = map[string]string{}

Expand Down Expand Up @@ -164,5 +168,6 @@ func main() {
v1.POST("/raspiBackup", handler.BackupHandler)
v1.GET("/", handler.IndexHandler)

api.Run(":8080")
fmt.Printf("INFO: Server now listening on %s\n", *listenAddress)
api.Run(*listenAddress)
}

0 comments on commit 662c07f

Please sign in to comment.