Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Update Smuggler Port Config
Browse files Browse the repository at this point in the history
  • Loading branch information
alecbcs committed Jun 15, 2021
1 parent adaf2ca commit 0bff0a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Config struct {

type general struct {
Version string
Port int64
Port string
}

type save struct {
Expand All @@ -33,7 +33,7 @@ func init() {

func defaultConfig() {
Global.General.Version = "0.0.1"
Global.General.Port = 8080
Global.General.Port = "4500"
Global.Save.Path = "smuggled/"
}

Expand Down
7 changes: 6 additions & 1 deletion smuggler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ import (
)

func main() {
port, err := strconv.Atoi(config.Global.General.Port)
if err != nil {
log.Fatal(err)
}

http.HandleFunc("/upload", web.Upload)
http.HandleFunc("/", web.NotFound)
fmt.Println("Smuggler Server Started!")
err := http.ListenAndServe(":"+strconv.FormatInt(int64(config.Global.General.Port), 10), nil)
err = http.ListenAndServe(":"+strconv.FormatInt(int64(port), 10), nil)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 0bff0a9

Please sign in to comment.