Aided stab at basic tokenizer and api setup.
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user