Add minimal logging
This commit is contained in:
parent
87cb056ce3
commit
5d94a64efe
1 changed files with 6 additions and 0 deletions
6
http.go
6
http.go
|
@ -8,7 +8,9 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
import "golang.org/x/crypto/blowfish"
|
||||
|
@ -56,11 +58,13 @@ func NewHttpServer(manager *Manager) *httpServer {
|
|||
|
||||
func (it *httpServer) Start() {
|
||||
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /", strings.ToUpper(request.Method))
|
||||
writer.WriteHeader(200)
|
||||
writer.Write([]byte("Don't"))
|
||||
})
|
||||
|
||||
http.HandleFunc("/create-csr", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /create-csr", strings.ToUpper(request.Method))
|
||||
req := &CreateCSRRequest{}
|
||||
err := it.verifyRequest(request, req)
|
||||
|
||||
|
@ -81,6 +85,7 @@ func (it *httpServer) Start() {
|
|||
})
|
||||
|
||||
http.HandleFunc("/deliver-crt", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /deliver-crt", strings.ToUpper(request.Method))
|
||||
req := &DeliverCertificateRequest{}
|
||||
err := it.verifyRequest(request, req)
|
||||
if err != nil {
|
||||
|
@ -98,6 +103,7 @@ func (it *httpServer) Start() {
|
|||
})
|
||||
|
||||
http.HandleFunc("/update-openvpn-config", func(writer http.ResponseWriter, request *http.Request) {
|
||||
log.Printf("%s /update-openvpn-config", strings.ToUpper(request.Method))
|
||||
req := &UpdateOpenVPNConfigRequest{}
|
||||
err := it.verifyRequest(request, req)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue