2016-01-25 00:01:37 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2016-02-03 01:22:45 +00:00
|
|
|
index_0 = []byte(`<!DOCTYPE html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><title>Dispatch</title><link href=/`)
|
2016-01-25 05:01:40 +00:00
|
|
|
index_1 = []byte(` rel=stylesheet></head><body><div id=root></div><script>window.__ENV__=`)
|
2016-01-25 21:41:54 +00:00
|
|
|
index_2 = []byte(`</script><script src=/`)
|
2016-01-25 05:01:40 +00:00
|
|
|
index_3 = []byte(`></script></body></html>`)
|
2016-01-25 00:01:37 +00:00
|
|
|
)
|
|
|
|
|
2016-01-26 21:10:44 +00:00
|
|
|
func renderIndex(w io.Writer, data interface{}) {
|
2016-01-25 05:01:40 +00:00
|
|
|
w.Write(index_0)
|
|
|
|
w.Write([]byte(files[1].Path))
|
|
|
|
w.Write(index_1)
|
2016-01-25 00:01:37 +00:00
|
|
|
|
2016-01-26 21:10:44 +00:00
|
|
|
json.NewEncoder(w).Encode(data)
|
2016-01-25 00:01:37 +00:00
|
|
|
|
2016-01-25 05:01:40 +00:00
|
|
|
w.Write(index_2)
|
|
|
|
w.Write([]byte(files[0].Path))
|
|
|
|
w.Write(index_3)
|
2016-01-25 00:01:37 +00:00
|
|
|
}
|