Error page + config + docker
This commit is contained in:
parent
7e821296a6
commit
c6c533a503
13 changed files with 110 additions and 31 deletions
12
main.go
12
main.go
|
|
@ -1,8 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"git.readonly.ch/bouzoure/gpx-downloader/helpers"
|
||||
"git.readonly.ch/bouzoure/gpx-downloader/routes"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/helmet/v2"
|
||||
|
|
@ -22,7 +24,15 @@ func main() {
|
|||
app.Get("/", routes.Index)
|
||||
app.Post("/fetch", routes.Fetch)
|
||||
|
||||
err := app.Listen("127.0.0.1:3000")
|
||||
config, err := helpers.ParseConfig("config.toml")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = app.Listen(fmt.Sprintf(
|
||||
"%s:%d",
|
||||
config.Server.Address, config.Server.Port,
|
||||
))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue