Adding page to create votes and view the votes, rearanging some methods
This commit is contained in:
11
server/common/common.go
Normal file
11
server/common/common.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
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