Files
amsterdam/server.go
T

31 lines
809 B
Go
Raw Normal View History

/*
* Amsterdam Web Communities System
* Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
2025-09-05 21:46:10 -06:00
package main
import (
"git.erbosoft.com/amy/amsterdam/ui"
2025-09-05 21:46:10 -06:00
"github.com/labstack/echo/v4"
)
func setupEcho() *echo.Echo {
2025-09-05 21:46:10 -06:00
e := echo.New()
2025-09-13 21:21:02 -06:00
e.Renderer = &ui.TemplateRenderer{}
e.GET("/img/*", ui.AmWrap(ui.AmServeImage))
e.GET("/", ui.AmWrap(func(ctxt ui.AmContext) (string, any, error) {
ctxt.VarMap().Set("amsterdam_pageTitle", "My Front Page")
2025-09-13 21:21:02 -06:00
return "framed_template", "top.jet", nil
}))
return e
}
func main() {
e := setupEcho()
2025-09-05 21:46:10 -06:00
e.Logger.Fatal(e.Start(":1323"))
}