From 00d5d19407dd2da0d6b36c3862b6204526ac8f7a Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 25 May 2018 12:43:30 -0700 Subject: [PATCH] Add basic code to serve Elm page. --- Makefile | 2 ++ external/GoUI | 2 +- src/Go.cr | 12 ++++++++++++ src/Go/views/game.ecr | 17 +++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 src/Go/views/game.ecr diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0f10866 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +generate-elm : + cd external/GoUI && elm make Go.elm --output ../../public/js/Go.js diff --git a/external/GoUI b/external/GoUI index 74d844b..e56560b 160000 --- a/external/GoUI +++ b/external/GoUI @@ -1 +1 @@ -Subproject commit 74d844b60f81ef4c4428f577d6b3c960a20f4bb6 +Subproject commit e56560bccea5d321e6afec83f0e702478b5270e1 diff --git a/src/Go.cr b/src/Go.cr index e33a041..0e7830e 100644 --- a/src/Go.cr +++ b/src/Go.cr @@ -1,6 +1,18 @@ require "./Go/*" +require "kemal" # TODO: Write documentation for `Go` module Go # TODO: Put your code here end + +URL = "localhost" + +get "/" do |env| + black = true + id = 1 + size = 9 + render "src/Go/views/game.ecr" +end + +Kemal.run diff --git a/src/Go/views/game.ecr b/src/Go/views/game.ecr new file mode 100644 index 0000000..e41f1f1 --- /dev/null +++ b/src/Go/views/game.ecr @@ -0,0 +1,17 @@ + + + + +
+ + + +