Templates + build
This commit is contained in:
parent
67e2e4d306
commit
7e821296a6
13 changed files with 202 additions and 15 deletions
|
|
@ -1,13 +1,16 @@
|
|||
package routes
|
||||
|
||||
import "github.com/gofiber/fiber/v2"
|
||||
import (
|
||||
"git.readonly.ch/bouzoure/gpx-downloader/helpers"
|
||||
"git.readonly.ch/bouzoure/gpx-downloader/templates"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func Index(c *fiber.Ctx) error {
|
||||
c.Set("Content-Type", "text/html")
|
||||
return c.SendString(`
|
||||
<form method="post" action="/fetch">
|
||||
<input name="url" required />
|
||||
<button type="submit">Fetch</button>
|
||||
</form>
|
||||
`)
|
||||
baseParams := templates.BaseTemplateParams{
|
||||
Title: "GPX downloader",
|
||||
}
|
||||
var indexParams templates.IndexParams
|
||||
|
||||
return helpers.TemplRender(c, templates.Index(baseParams, indexParams))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue