From 0833852238c937009d3668d21124ca86b3d93f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCller?= Date: Sat, 9 Sep 2017 13:23:01 +0200 Subject: [PATCH] first server version added --- Gopkg.lock | 57 ++++++++++++++++++++++++++++++++++++++++ Gopkg.toml | 3 +++ assets/public/index.html | 7 +++-- assets/public/style.css | 24 +++++++++-------- server.go | 18 +++++++++++++ 5 files changed, 94 insertions(+), 15 deletions(-) create mode 100644 Gopkg.lock create mode 100644 Gopkg.toml create mode 100644 server.go diff --git a/Gopkg.lock b/Gopkg.lock new file mode 100644 index 0000000..4a6d6f5 --- /dev/null +++ b/Gopkg.lock @@ -0,0 +1,57 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/labstack/echo" + packages = ["."] + revision = "cec7629194fe4bf83b0c72d9a02d340c7a1468ac" + version = "3.2.3" + +[[projects]] + name = "github.com/labstack/gommon" + packages = ["color","log"] + revision = "779b8a8b9850a97acba6a3fe20feb628c39e17c1" + version = "0.2.2" + +[[projects]] + name = "github.com/mattn/go-colorable" + packages = ["."] + revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072" + version = "v0.0.9" + +[[projects]] + name = "github.com/mattn/go-isatty" + packages = ["."] + revision = "fc9e8d8ef48496124e79ae0df75490096eccf6fe" + version = "v0.0.2" + +[[projects]] + branch = "master" + name = "github.com/valyala/bytebufferpool" + packages = ["."] + revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7" + +[[projects]] + branch = "master" + name = "github.com/valyala/fasttemplate" + packages = ["."] + revision = "dcecefd839c4193db0d35b88ec65b4c12d360ab0" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["acme","acme/autocert"] + revision = "81e90905daefcd6fd217b62423c0908922eadb30" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = ["unix"] + revision = "a5054c7c1385fd50d9394475365355a87a7873ec" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "e1534696ddba3fee15190f7971602342df68b7eba8217a1438fd7dd150d82ba1" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 0000000..2ba8a5e --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,3 @@ +[[constraint]] + name = "github.com/labstack/echo" + version = "3.1.0" diff --git a/assets/public/index.html b/assets/public/index.html index 862337d..411aaf8 100644 --- a/assets/public/index.html +++ b/assets/public/index.html @@ -1,7 +1,7 @@ - NoteHub — Free Pastebin for One-Off Markdown Publishing + NoteHub — Pastebin for One-Off Markdown Publishing @@ -9,7 +9,7 @@

NoteHub

-

Free and Hassle-free Pastebin for Markdown Notes

+

Pastebin for One-Off Markdown Publishing


See Demo Note New Note @@ -18,8 +18,7 @@

Changelog

    -
  • 2017-08: NoteHub 3.0 released.
  • -
  • 2016-08: Syntax highlighting for code blocks added (thanks to Maciej).
  • +
  • 2017-08: NoteHub 3.0 released: rewritten in Go; all features but essential dropped.
  • 2016-03: Note deletion feature added.
  • 2015-10: NoteHub rewritten in Node.js.
  • 2015-10: NoteHub API and note styling discontinued due to low adoption.
  • diff --git a/assets/public/style.css b/assets/public/style.css index 0eed931..22acacd 100644 --- a/assets/public/style.css +++ b/assets/public/style.css @@ -18,13 +18,24 @@ html, body { padding-top: 5em; } +#hero h1 { + font-family: Impact; + font-size: 2.5em; +} + +#hero h2 { + margin: 2em; + font-family: sans-serif; + font-weight: 300; +} + + .ui-border { border-radius: 3px; border: 1px solid #333; } a { - border-bottom: 1px dotted; text-decoration: none; color: #097; } @@ -34,7 +45,7 @@ a:hover { } a:visited { - color: #054; + color: #075; } .button { @@ -119,15 +130,6 @@ h6 { font-size: 1.0em; } -#hero h1 { - font-size: 2.5em; -} - -#hero h2 { - margin: 2em; - font-weight: 300; -} - #dashed-line { border-bottom: 1px dashed#888; } diff --git a/server.go b/server.go new file mode 100644 index 0000000..c35870f --- /dev/null +++ b/server.go @@ -0,0 +1,18 @@ +package main + +import ( + "net/http" + + "github.com/labstack/echo" +) + +func main() { + e := echo.New() + + e.Static("/", "assets/public") + + e.GET("/", func(c echo.Context) error { + return c.String(http.StatusOK, "Hello, World!") + }) + e.Logger.Fatal(e.Start(":3000")) +}