This commit is contained in:
a-ill
2023-06-14 21:41:54 +03:00
parent 4d034eba7d
commit 9e8ee05bb6
128 changed files with 12242 additions and 0 deletions

15
Server/config/env/dev.jl vendored Normal file
View File

@@ -0,0 +1,15 @@
using Genie, Logging
Genie.Configuration.config!(
server_port = 8000,
server_host = "0.0.0.0",
log_level = Logging.Info,
log_to_file = false,
server_handle_static_files = true,
path_build = "build",
format_julia_builds = true,
format_html_output = true,
watch = true
)
ENV["JULIA_REVISE"] = "auto"

2
Server/config/env/global.jl vendored Normal file
View File

@@ -0,0 +1,2 @@
# Place here configuration options that will be set for all environments
# ENV["GENIE_ENV"] = "prod"

19
Server/config/env/prod.jl vendored Normal file
View File

@@ -0,0 +1,19 @@
using Genie, Logging
Genie.Configuration.config!(
server_port = 8000,
server_host = "0.0.0.0",
log_level = Logging.Error,
log_to_file = false,
server_handle_static_files = true, # for best performance set up Nginx or Apache web proxies and set this to false
path_build = "build",
format_julia_builds = false,
format_html_output = false
)
if Genie.config.server_handle_static_files
@warn("For performance reasons Genie should not serve static files (.css, .js, .jpg, .png, etc) in production.
It is recommended to set up Apache or Nginx as a reverse proxy and cache to serve static assets.")
end
ENV["JULIA_REVISE"] = "off"

14
Server/config/env/test.jl vendored Normal file
View File

@@ -0,0 +1,14 @@
using Genie, Logging
Genie.Configuration.config!(
server_port = 8000,
server_host = "0.0.0.0",
log_level = Logging.Info,
log_to_file = false,
server_handle_static_files = false,
path_build = "build",
format_julia_builds = false,
format_html_output = false,
)
ENV["JULIA_REVISE"] = "auto"

View File

@@ -0,0 +1,2 @@
# Optional flat/non-resource MVC folder structure
# Genie.Loader.autoload(abspath("models"), abspath("controllers"))

View File

@@ -0,0 +1,6 @@
using Dates
import Base.convert
convert(::Type{Int}, v::SubString{String}) = parse(Int, v)
convert(::Type{Float64}, v::SubString{String}) = parse(Float64, v)
convert(::Type{Date}, s::String) = parse(Date, s)

View File

@@ -0,0 +1,5 @@
import Inflector, Genie
if ! isempty(Genie.config.inflector_irregulars)
push!(Inflector.IRREGULAR_NOUNS, Genie.config.inflector_irregulars...)
end

View File

@@ -0,0 +1,3 @@
import Genie
Genie.Logger.initialize_logging()

View File

@@ -0,0 +1,17 @@
using SearchLight
using Genie
function Genie.Renderer.Json.JSON3.StructTypes.StructType(::Type{T}) where {T<:SearchLight.AbstractModel}
Genie.Renderer.Json.JSON3.StructTypes.Struct()
end
function Genie.Renderer.Json.JSON3.StructTypes.StructType(::Type{SearchLight.DbId})
Genie.Renderer.Json.JSON3.StructTypes.Struct()
end
function foreign_key(name, table,name2)
return string("FOREIGN KEY (`",name,"`) REFERENCES `",table,"`(`",name2,"`) ON DELETE CASCADE")
end
SearchLight.Configuration.load(context = @__MODULE__)
SearchLight.connect()

1
Server/config/secrets.jl Normal file
View File

@@ -0,0 +1 @@
Genie.Secrets.secret_token!("e536cc13ab920bffa6843223bd535f0d427b797452a1577ed2118d2d2d22f0bb")