Initial commit

This commit is contained in:
Jesse Malotaux 2025-02-25 21:03:03 +01:00
commit d2d9aca35c
35 changed files with 4310 additions and 0 deletions

52
be/.air.toml Normal file
View file

@ -0,0 +1,52 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"
[build]
args_bin = []
bin = "tmp\\main.exe"
cmd = "go build -o ./tmp/main.exe ."
delay = 1000
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
follow_symlink = false
full_bin = ""
include_dir = []
include_ext = ["go", "tpl", "tmpl", "html"]
include_file = []
kill_delay = "0s"
log = "build-errors.log"
poll = false
poll_interval = 0
post_cmd = []
pre_cmd = []
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false
[color]
app = ""
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
main_only = false
silent = false
time = false
[misc]
clean_on_exit = false
[proxy]
app_port = 0
enabled = false
proxy_port = 0
[screen]
clear_on_rebuild = false
keep_scroll = true

3
be/go.mod Normal file
View file

@ -0,0 +1,3 @@
module example.com/m
go 1.24.0

23
be/index.html Normal file
View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 - BALLS</title>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
</style>
</head>
<body>
<h1>Balls found</h1>
<span>So not the content you're looking for.</span>
</body>
</html>

38
be/main.go Normal file
View file

@ -0,0 +1,38 @@
package main
import (
"log"
"mime"
"net/http"
"path/filepath"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// log.Println(r.URL.Path)
file := "../public" + r.URL.Path
if r.URL.Path == "/" {
file = "../public/index.html"
// } else if strings.HasSuffix(r.URL.Path, ".js") {
// log.Println("js")
// w.Header().Set("Content-Type", "application/javascript")
// } else if strings.HasSuffix(r.URL.Path, ".css") {
// log.Println("css")
// w.Header().Set("Content-Type", "text/css")
// }
} else {
contentType := mime.TypeByExtension(filepath.Ext(file))
if contentType != "" {
w.Header().Set("Content-Type", contentType)
}
}
log.Println(file)
log.Println("-------------")
http.ServeFile(w, r, file)
})
log.Fatal(http.ListenAndServe(":6970", nil))
}

1
be/tmp/build-errors.log Normal file
View file

@ -0,0 +1 @@
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1

BIN
be/tmp/main.exe Normal file

Binary file not shown.