-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenie.jl
51 lines (36 loc) · 1.21 KB
/
genie.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Revise
"""
bootstrap_genie() :: Nothing
Bootstraps the Genie framework setting up paths and workers. Invoked automatically.
"""
function bootstrap() :: Nothing
cd(@__DIR__)
printstyled("""
_____ _
| __|___ ___|_|___
| | | -_| | | -_|
|_____|___|_|_|_|___|
""", color = :magenta)
DEFAULT_NWORKERS_REPL = 1
DEFAULT_NWORKERS_SERVER = 1
isfile("env.jl") && include("env.jl")
haskey(ENV, "GENIE_ENV") || (ENV["GENIE_ENV"] = "dev")
@info "\nStarting Genie in >> $(ENV["GENIE_ENV"] |> uppercase) << mode \n\n"
push!(LOAD_PATH, pwd(), "src")
nothing
end
bootstrap()
include(joinpath("src", "App.jl")); using .App
include(joinpath("src", "Toolbox.jl")); using .Toolbox
using Genie
function main()
Core.eval(Genie, Meta.parse("""push!(LOAD_PATH, joinpath($(repr(pwd())), "src"))"""))
Core.eval(Genie, Meta.parse("const App = $(@__MODULE__).App"))
Core.eval(Genie, Meta.parse("const Toolbox = $(@__MODULE__).Toolbox"))
load()
Core.eval(Genie, Meta.parse("config = App.config"))
Core.eval(Genie, Meta.parse("""const SECRET_TOKEN = "$(secret_token())" """))
Core.eval(Genie, Meta.parse("""const ASSET_FINGERPRINT = "$(App.ASSET_FINGERPRINT)" """))
Genie.run()
end
main()