Aided stab at basic tokenizer and api setup.

This commit is contained in:
2025-12-19 18:46:03 -07:00
parent 1e90cbbb39
commit 7686b1b9f0
9 changed files with 446 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import (
"path"
"strings"
"github.com/smjklake/glancr/internal/api"
"github.com/smjklake/glancr/internal/fs"
)
@@ -31,8 +32,15 @@ func spaHandler() http.HandlerFunc {
}
func main() {
// Initialize API
apiHandler := api.NewAPI()
// API routes
http.HandleFunc("/api/file", apiHandler.HandleFile)
// SPA handler for everything else
http.HandleFunc("/", spaHandler())
log.Println("Starting glancr on port 8080")
http.HandleFunc("/", spaHandler())
log.Fatal(http.ListenAndServe(":8080", nil))
}