Skip to content

Commit 9ce0501

Browse files
committed
Add new logo
1 parent 4e00754 commit 9ce0501

File tree

6 files changed

+85
-5
lines changed

6 files changed

+85
-5
lines changed
-6.97 KB
Loading
13.7 KB
Loading
Lines changed: 22 additions & 5 deletions
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
defmodule CodebattleWeb.DevToolsController do
2+
use CodebattleWeb, :controller
3+
4+
@doc """
5+
Returns Chrome DevTools IDE integration configuration.
6+
Enables "Open in Editor" functionality from Chrome DevTools.
7+
8+
Supported editors: vscode, cursor, zed, webstorm, idea
9+
Change the editor below to match your preference.
10+
"""
11+
def index(conn, _params) do
12+
# Change this to your preferred editor: "vscode", "cursor", "zed", "webstorm", "idea"
13+
editor = "cursor"
14+
15+
config = %{
16+
"workspace" => %{
17+
"root" => File.cwd!(),
18+
"uuid" => "codebattle-dev-workspace"
19+
},
20+
"editor" => editor_config(editor)
21+
}
22+
23+
json(conn, config)
24+
end
25+
26+
defp editor_config("vscode") do
27+
%{"name" => "vscode", "scheme" => "vscode://file%s:%l:%c"}
28+
end
29+
30+
defp editor_config("cursor") do
31+
%{"name" => "cursor", "scheme" => "cursor://file%s:%l:%c"}
32+
end
33+
34+
defp editor_config("zed") do
35+
%{"name" => "zed", "scheme" => "zed://open?path=%s&line=%l&column=%c"}
36+
end
37+
38+
defp editor_config("webstorm") do
39+
%{"name" => "webstorm", "scheme" => "webstorm://open?file=%s&line=%l&column=%c"}
40+
end
41+
42+
defp editor_config("idea") do
43+
%{"name" => "idea", "scheme" => "idea://open?file=%s&line=%l&column=%c"}
44+
end
45+
46+
defp editor_config(_), do: editor_config("vscode")
47+
end

services/app/apps/codebattle/lib/codebattle_web/endpoint.ex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ defmodule CodebattleWeb.Endpoint do
3939
only: ~w(assets css fonts images js favicon.ico robots.txt)
4040
)
4141

42+
# Serve static files (images, fonts, audio) from assets/static in development
43+
# These are served at /assets/* to match the URL paths used in templates
44+
if Mix.env() == :dev do
45+
plug(
46+
Plug.Static,
47+
at: "/assets",
48+
from: "apps/codebattle/assets/static",
49+
gzip: false
50+
)
51+
end
52+
4253
# Code reloading can be explicitly enabled under the
4354
# :code_reloader configuration of your endpoint.
4455
if code_reloading? do

services/app/apps/codebattle/lib/codebattle_web/router.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ defmodule CodebattleWeb.Router do
7979
get("/health", HealthController, :index)
8080
end
8181

82+
# Chrome DevTools IDE integration (dev only)
83+
scope "/.well-known/appspecific", CodebattleWeb do
84+
get("/com.chrome.devtools.json", DevToolsController, :index)
85+
end
86+
8287
scope "/admin" do
8388
pipe_through([:browser, :admins_only])
8489
live_dashboard("/dashboard", metrics: CodebattleWeb.Telemetry)

0 commit comments

Comments
 (0)