Add a port variable.

This commit is contained in:
Danila Fedorin 2018-05-26 00:33:12 -07:00
parent a6260deefd
commit 0145903e70
2 changed files with 2 additions and 1 deletions

View File

@ -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?

View File

@ -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 %>
})