adding nixosModule and test

This commit is contained in:
2023-10-05 16:47:24 +02:00
parent ecd76439f3
commit be58c073f0
5 changed files with 109 additions and 12 deletions

View File

@@ -195,11 +195,13 @@ func GetNextNDaysOfName(n int, name time.Weekday, current time.Time) []time.Time
}
const DB_NAME = "./tasklist.db"
const FORMS_NAME = "./forms.html"
const TASK_DAY = time.Tuesday
const AMOUNT_DAYS = 4
func main() {
dbName := flag.String("d", DB_NAME, "path to db file")
formsName := flag.String("f", FORMS_NAME, "path to form file")
flag.Parse()
db := InitDB(*dbName)
@@ -210,7 +212,7 @@ func main() {
return
}
tmpl := template.Must(template.ParseFiles("forms.html"))
tmpl := template.Must(template.ParseFiles(*formsName))
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
days := GetNextNDaysOfName(AMOUNT_DAYS, TASK_DAY, time.Now())
tasklist_arr := QueryResult{make([]Tasklist, AMOUNT_DAYS)}