From 0145903e705b513b61549790261ca2036dae6e7f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 26 May 2018 00:33:12 -0700 Subject: [PATCH] Add a port variable. --- src/Go.cr | 1 + src/Go/views/game.ecr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Go.cr b/src/Go.cr index d500ec3..5a5418b 100644 --- a/src/Go.cr +++ b/src/Go.cr @@ -3,6 +3,7 @@ require "kemal" require "json" URL = "localhost" +PORT = "3000" GAME_CACHE = {} of String => Go::Game def query_game(db, id) : Go::Game? diff --git a/src/Go/views/game.ecr b/src/Go/views/game.ecr index 816e39e..d11de30 100644 --- a/src/Go/views/game.ecr +++ b/src/Go/views/game.ecr @@ -4,7 +4,7 @@ var node = document.getElementById('elm-root') var app = Elm.Main.embed(node, { 'black' : <%= black %>, - 'url' : "<%= "ws://" + URL + ":" + Kemal.config.port.to_s %>", + 'url' : "<%= "ws://" + URL + ":" + PORT %>", 'id' : "<%= id %>", 'size' : <%= size %> })