Fixing up the go code, adding initial work for the stats pages, adding a function to pre-populate the database with some example polls for testing. Will be removed later
This commit is contained in:
@@ -5,6 +5,11 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const (
|
||||
DATE_FORMAT = "2006-01-02 15:04:05"
|
||||
SUCCESS = "success"
|
||||
)
|
||||
|
||||
func SendError(w http.ResponseWriter, errStr string, statusCode int) {
|
||||
w.WriteHeader(statusCode)
|
||||
json.NewEncoder(w).Encode(map[string]string{"error": errStr})
|
||||
|
||||
Reference in New Issue
Block a user