This commit is contained in:
Ian Gulliver
2024-12-21 06:35:49 -08:00
parent 06495d9258
commit 050d716a3c
5 changed files with 22 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ func NewTasks(db *sql.DB) (*Tasks, error) {
}
t.mux.HandleFunc("GET /{$}", t.serveRoot)
t.mux.Handle("GET /", http.FileServer(http.Dir("static")))
return t, nil
}
@@ -92,7 +93,7 @@ func (t *Tasks) initRequest(w http.ResponseWriter, r *http.Request) error {
}
}
log.Printf("%s %s %s %s %s %#v", r.RemoteAddr, r.Method, r.Host, r.URL, r.Form)
log.Printf("%s %s %s %s %s", r.RemoteAddr, r.Method, r.Host, r.URL, r.Form)
return nil
}

View File

@@ -28,6 +28,6 @@ body {
<script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.18.0/cdn/shoelace-autoloader.js"></script>
</head>
<body>
tasks!
<script type="module" src="main.js"></script>
</body>
</html>

5
static/main.js Normal file
View File

@@ -0,0 +1,5 @@
"use strict";
function main() {
console.log("Hello, world!");
}
main();

5
ts/main.ts Normal file
View File

@@ -0,0 +1,5 @@
function main() {
console.log("Hello, world!");
}
main();

9
tsconfig.json Normal file
View File

@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"strict": true,
"outDir": "static"
},
"include": ["ts"],
}