Skip to content

Commit

Permalink
Add listen address flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Nov 27, 2023
1 parent cf7bbe6 commit acea4b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"flag"
"instafix/handlers"
data "instafix/handlers/data"
"instafix/views"
Expand Down Expand Up @@ -30,6 +31,9 @@ func init() {
}

func main() {
listenAddr := flag.String("listen", "0.0.0.0:3000", "Address to listen on")
flag.Parse()

app := fiber.New()

recoverConfig := recover.ConfigDefault
Expand Down Expand Up @@ -70,7 +74,7 @@ func main() {
app.Get("/grid/:postID", handlers.Grid())
app.Get("/oembed", handlers.OEmbed())

app.Listen("0.0.0.0:3000")
app.Listen(*listenAddr)
}

// Remove file in static folder until below threshold
Expand Down

0 comments on commit acea4b5

Please sign in to comment.