adding nixosModule and test
This commit is contained in:
4
main.go
4
main.go
@@ -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)}
|
||||
|
||||
Reference in New Issue
Block a user