Created template dir

drew/sql-it
Drew Bednar 7 months ago
parent 7048d507ce
commit a51cc3903f

@ -1 +1 @@
This is my fixed test page
This is my fixed test page. Work!

@ -1,15 +1,18 @@
package main
import (
"html/template"
"log"
"net/http"
"os"
"regexp"
"text/template"
)
// Template caching
var templates = template.Must(template.ParseFiles("edit.html", "view.html"))
// var templates = template.Must(template.ParseFiles("edit.html", "view.html"))
var templates = template.Must(template.ParseGlob("./tmpl/*.html"))
// var templates = template.Must(template.ParseFiles("edit.html", "view.html"))
// Validation to prevent abitrary paths
var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$")

Loading…
Cancel
Save