1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
72e3d5ea65 Add server script 2023-11-21 13:15:27 -06:00
8026e8ccec We don't need JSX anymore 2023-11-21 13:15:17 -06:00
278025b098 Address genserver failures in tests 2023-11-21 13:15:06 -06:00
3 changed files with 9 additions and 1 deletions

3
bin/server Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
mix phx.server

View File

@ -39,7 +39,7 @@ config :esbuild,
version: "0.19.4", version: "0.19.4",
default: [ default: [
args: args:
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/js --external:/fonts/* --external:/images/* --loader:.js=jsx), ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/js --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__), cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)} env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
] ]

View File

@ -75,6 +75,8 @@ defmodule ChessWeb.BoardLive do
_ -> _ ->
handle_move(socket, file, rank) handle_move(socket, file, rank)
end end
else
[]
end end
assign(socket, assigns) assign(socket, assigns)
@ -121,6 +123,9 @@ defmodule ChessWeb.BoardLive do
{:board, game.board}, {:board, game.board},
{:game, game} {:game, game}
] ]
{:error, _, _, _} ->
[]
end end
else else
[{:selected, nil}, {:available, []}] [{:selected, nil}, {:available, []}]