First commit

This commit is contained in:
Egor 2024-06-20 16:47:04 +03:00
commit 3805296d32
6 changed files with 37 additions and 0 deletions

8
.air.toml Normal file
View file

@ -0,0 +1,8 @@
root = "."
tmp_dir = "tmp"
[build]
bin = "tmp/main"
cmd = "templ generate && go build -o tmp/main ."
include_ext = ["go", "templ", "html"]
exclude_regex = [".*_templ.go"]

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
tmp/
*_templ.go

5
go.mod Normal file
View file

@ -0,0 +1,5 @@
module erius.ru/passwd-mgr
go 1.22.4
require github.com/a-h/templ v0.2.707 // indirect

2
go.sum Normal file
View file

@ -0,0 +1,2 @@
github.com/a-h/templ v0.2.707 h1:T1Gkd2ugbRglZ9rYw/VBchWOSZVKmetDbBkm4YubM7U=
github.com/a-h/templ v0.2.707/go.mod h1:5cqsugkq9IerRNucNsI4DEamdHPsoGMQy99DzydLhM8=

5
hello.templ Normal file
View file

@ -0,0 +1,5 @@
package main
templ hello(name string) {
<div>Hello, { name }</div>
}

15
main.go Normal file
View file

@ -0,0 +1,15 @@
package main
import (
"fmt"
"net/http"
"github.com/a-h/templ"
)
func main() {
component := hello("John")
http.Handle("/", templ.Handler(component))
fmt.Println("Listening on :3000")
http.ListenAndServe(":3000", nil)
}