From: Ben Beltran Date: Mon, 28 Nov 2016 06:57:58 +0000 (-0600) Subject: Serve the basic design X-Git-Url: https://git.r.bdr.sh/rbdr/lgtm/commitdiff_plain/322c92fdfbbef070b171b700d24c6733ac2e0ef9?ds=inline;hp=702077266d36d190a454a2665b7e31c8f64746ac Serve the basic design --- diff --git a/config/config.js b/config/config.js new file mode 100644 index 0000000..3204568 --- /dev/null +++ b/config/config.js @@ -0,0 +1,10 @@ +'use strict'; + +const Getenv = require('getenv'); + +const internals = {}; + +module.exports = internals.Config = { + port: Getenv.int('LGTM_PORT', 1728), + staticDirectory: Getenv('LGTM_STATIC_DIRECTORY', 'static') +}; diff --git a/index.js b/index.js new file mode 100644 index 0000000..46d4049 --- /dev/null +++ b/index.js @@ -0,0 +1,29 @@ +'use strict'; + +const Config = require('./config/config'); +const Koa = require('koa'); +const KoaStatic = require('koa-static'); + +const internals = {}; + +internals.run = () => { + + internals.app = Koa(); + + internals.app.use(KoaStatic(Config.staticDirectory)); + + console.log(' .'); + console.log(' /'); + console.log(' +-----+'); + console.log(` | o o | - Listening Gladly, Try Me: ${Config.port}`); + console.log(' +-----+'); + console.log(' +---------+'); + console.log(' /| [][] |\\'); + console.log(' || | |'); + console.log(' || | \\c'); + console.log(' ^+---------+'); + console.log(' (.) '); + internals.app.listen(Config.port); +}; + +internals.run(); diff --git a/package.json b/package.json index 5adb80a..54cad7c 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "lint": "eslint .", + "start": "node index", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -19,7 +20,8 @@ "homepage": "https://github.com/rbdr/lgtm#readme", "dependencies": { "getenv": "^0.7.0", - "koa": "^1.2.4" + "koa": "^1.2.4", + "koa-static": "^2.0.0" }, "devDependencies": { "eslint-config-hapi": "^10.0.0", diff --git a/static/css/app.css b/static/css/app.css new file mode 100644 index 0000000..ce1f73f --- /dev/null +++ b/static/css/app.css @@ -0,0 +1,18 @@ +* { + margin: 0; + padding: 0 +} + +#lgtm { + height: 100vh; + display: flex; + align-items: center; + justify-content: center; +} + +#lgtm p { + color: #3B3B3B; + font-family: Yrsa, serif; + font-size: 48px; + line-height: 0.96em; +} diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..cc5b8a2 --- /dev/null +++ b/static/index.html @@ -0,0 +1,23 @@ + + + + LGTM! 👍 + + + + + + +
+

+ Looks
+ Good
+ To
+ Me
+
+ 👍 +

+
+ + + diff --git a/yarn.lock b/yarn.lock index f687126..441620e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,11 +7,11 @@ accepts@^1.2.2: mime-types "~2.1.11" negotiator "0.6.1" -any-promise@^1.1.0: +any-promise@^1.0.0, any-promise@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" -co@^4.0.2, co@^4.4.0: +co@^4.0.2, co@^4.4.0, co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -111,7 +111,7 @@ http-assert@^1.1.0: deep-equal "~1.0.0" http-errors "~1.4.0" -http-errors@^1.2.8: +http-errors@^1.2.8, http-errors@~1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.5.1.tgz#788c0d2c1de2c81b9e6e8c01843b6b97eb920750" dependencies: @@ -146,6 +146,22 @@ koa-is-json@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/koa-is-json/-/koa-is-json-1.0.0.tgz#273c07edcdcb8df6a2c1ab7d59ee76491451ec14" +koa-send@~3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/koa-send/-/koa-send-3.1.1.tgz#ef0af0f9a531ec817e88056b52b8e32d2e0ba91a" + dependencies: + co "^4.6.0" + debug "*" + mz "^2.3.1" + resolve-path "^1.3.1" + +koa-static: + version "2.0.0" + resolved "https://registry.yarnpkg.com/koa-static/-/koa-static-2.0.0.tgz#2693482e1a4c0219e6d926be1703a2658b754f26" + dependencies: + debug "*" + koa-send "~3.1.0" + koa@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/koa/-/koa-1.2.4.tgz#6ef6d17a7bea8ec778a8572b55a0d0562e488654" @@ -192,6 +208,14 @@ ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +mz@^2.3.1: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.6.0.tgz#c8b8521d958df0a4f2768025db69c719ee4ef1ce" + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" @@ -200,6 +224,10 @@ no-arrowception@1.x.x: version "1.0.0" resolved "https://registry.yarnpkg.com/no-arrowception/-/no-arrowception-1.0.0.tgz#5bf3e95eb9c41b57384a805333daa3b734ee327a" +object-assign@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + on-finished@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -214,6 +242,17 @@ parseurl@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" +path-is-absolute@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +resolve-path@^1.3.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve-path/-/resolve-path-1.3.3.tgz#4d83aba6468c2b8e632a575e3f52b0fa0dbe1a5c" + dependencies: + http-errors "~1.5.0" + path-is-absolute "1.0.1" + setprototypeof@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.2.tgz#81a552141ec104b88e89ce383103ad5c66564d08" @@ -222,6 +261,18 @@ statuses@^1.2.0, "statuses@>= 1.2.1 < 2", "statuses@>= 1.3.1 < 2": version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.2.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.2.1.tgz#251fd1c80aff6e5cf57cb179ab1fcb724269bd11" + dependencies: + any-promise "^1.0.0" + type-is@^1.5.5: version "1.6.14" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.14.tgz#e219639c17ded1ca0789092dd54a03826b817cb2"