Get the server running with the basic static stuff
--- a/config/config.go Sat May 26 17:38:03 2018 -0500
+++ b/config/config.go Sat May 26 17:38:15 2018 -0500
@@ -5,8 +5,10 @@
- Hostname string `envconfig:"HOSTNAME"`
- Port int32 `envconfig:"PORT"`
+ ListenAddr string `envconfig:"LISTEN_ADDR" default:"0.0.0.0:9999"` + Hostname string `envconfig:"HOSTNAME"` + Port int32 `envconfig:"PORT"` + StaticFilesPath string `envconfig:"STATIC_FILES_PATH" default:"static"` --- a/main.go Sat May 26 17:38:03 2018 -0500
+++ b/main.go Sat May 26 17:38:15 2018 -0500
@@ -3,16 +3,52 @@
+ "github.com/aphistic/gomol" "bitbucket.org/rw_grim/peacock/logging"
+ "bitbucket.org/rw_grim/peacock/server"
+ fmt.Printf("error: %s\n", err)
+ // setup a signal channel + signalChan := make(chan os.Signal, 1) + signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM) + // setup the error channel + errChan := make(chan error, 10) + srv := server.New(errChan) + gomol.Fatalf("error: %s", err) + case s := <-signalChan: + gomol.Warnf("Captured %v. Exiting...", s) --- a/server/server.go Sat May 26 17:38:03 2018 -0500
+++ b/server/server.go Sat May 26 17:38:15 2018 -0500
@@ -3,6 +3,7 @@
+ "github.com/aphistic/gomol" "github.com/aphistic/negroni-gomol"
"github.com/pilu/xrequestid"
"github.com/urfave/negroni"
@@ -32,8 +33,13 @@
-func setupRoutes() *http.Handler {
+func setupRoutes(cfg config.Config) http.Handler { + router := http.NewServeMux() + static := http.FileServer(http.Dir(cfg.StaticFilesPath)) + router.Handle("/", static) func New(errChan chan error) *Server {
@@ -52,8 +58,15 @@
func (s *Server) Start() {
+ gomol.Infof("Webserver listening on %s", cfg.ListenAddr) + s.server.ListenAndServe() func (s *Server) Stop() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/css/app.css Sat May 26 17:38:15 2018 -0500
@@ -0,0 +1,87 @@
+ background-color: #bcd765 !important; + font-family: 'Source Code Pro', monospace !important; + font-weight: bold !important; + font-style: normal !important; + grid-template-columns: repeat(2, 1fr); + grid-template-rows: repeat(2, 1fr); + grid-template-rows: repeat(2, 1fr); + background-color: #272822; + background-image: url('/img/grim-transparentish.png'); + background-size: 100vh; + background-repeat: no-repeat; Binary file static/img/grim-hacking.png has changed
Binary file static/img/grim-transparentish.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/index.html Sat May 26 17:38:15 2018 -0500
@@ -0,0 +1,36 @@
+ <script src="https://unpkg.com/vue/dist/vue.min.js"></script> + <script src="https://use.fontawesome.com/5854255963.js"></script> + <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet"> + <link rel="stylesheet" type="text/css" href="/css/app.css"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <div class="title-block"> + <div class="name">{{name}}</div> + <div v-for="title in titles">{{title}}</div> + <div class="vcard-container"> + <div class="vcard-wrapper"> + <div><span class="identifier">source</span> <span class="operator">=</span> <span class="token">{</span></div> + <div v-for="item in vcard"> + <span class="string">"<i v-bind:class="'fa fa-' + item.icon"></i>"</span><span class="token">:</span> <span class="string">"<a v-bind:href="item.href">{{item.text}}</a>"</span><span class="token">,</span> + <div><span class="token">}</span></div> + <div class="reaper"></div> + <script src="/js/app.js"></script> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/js/app.js Sat May 26 17:38:15 2018 -0500
@@ -0,0 +1,50 @@
+ "Open Source Developer", + "Pidgin Lead Developer", + 'href': 'https://bitbucket.org/rw_grim', + 'href': 'mailto:grim@reaperworld.com', + 'text': 'grim@reaperworld.com', + 'href': 'https://github.com/grimmy', + 'icon': 'reddit-alien', + 'href': 'https://www.reddit.com/user/rw_grim', + 'icon': 'stack-overflow', + 'href': 'https://stackoverflow.com/users/852948/grim', + 'href': 'http://steamcommunity.com/id/rw_grim', + 'href': 'https://twitch.tv/rw_grim', + 'href': 'https://www.twitter.com/rw_grim', + 'href': 'https://www.youtube.com/garykramlich', + 'text': 'garykramlich',