Enable UI handling logic with dev passthrough directories. (#145)

* Enable UI handling logic with dev passthrough directories.

* Add tests and fix a couple of things
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-06-24 16:06:19 -04:00
1 parent 6641244734
commit 8de5371499
6 files changed
+280 -19

No files matched your search

@@ -0,0 +1,32 @@
package controller
import (
"bytes"
"net/http"
)
type indexResponseWriter struct {
statusCode int
header http.Header
body *bytes.Buffer
}
// newindexResponseWriter returns an initialized indexResponseWriter
func newIndexResponseWriter() *indexResponseWriter {
return &indexResponseWriter{
header: make(http.Header),
body: new(bytes.Buffer),
}
}
func (w *indexResponseWriter) Header() http.Header {
return w.header
}
func (w *indexResponseWriter) Write(buf []byte) (int, error) {
return w.body.Write(buf)
}
func (w *indexResponseWriter) WriteHeader(code int) {
w.statusCode = code
}