Skip to content

Commit 30a0044

Browse files
committed
define relocatable FAVICON_PATH
using the `RelocatableFolders` package
1 parent 4d93ee8 commit 30a0044

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1616
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
1717
MD5 = "6ac74813-4b46-53a4-afec-0b5dc9d7885c"
1818
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
19+
RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00"
1920
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
2021
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2122
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
@@ -33,6 +34,7 @@ HTTP = "1"
3334
JSON = "0.21"
3435
JSON3 = "1.9"
3536
MD5 = "0.2"
37+
RelocatableFolders = "1"
3638
YAML = "0.4.7"
3739
julia = "1.6"
3840

src/handler/processors/default_favicon.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
12
function process_default_favicon(request::HTTP.Request, state::HandlerState)
2-
ico_contents = read(
3-
joinpath(ROOT_PATH, "src", "favicon.ico")
4-
)
3+
ico_contents = read(FAVICON_PATH)
54
return HTTP.Response(
65
200,
76
["Content-Type" => "image/x-icon"],

src/init/resources.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
using YAML
2+
using RelocatableFolders: @path
3+
4+
# TODO move to DashCoreResources
5+
const FAVICON_PATH = @path joinpath(@__DIR__, "..", "favicon.ico")
26

37
load_meta(name) = YAML.load_file(
48
joinpath(artifact"dash_resources", "$(name).yaml")

0 commit comments

Comments
 (0)