29 lines
595 B
Julia
29 lines
595 B
Julia
using Mux
|
|
using HTTP
|
|
using Revise
|
|
|
|
push!(LOAD_PATH, "/home/nixo/memories/projects/2018-2019/musicjl")
|
|
import Beets
|
|
Beets.update_albums();
|
|
push!(LOAD_PATH, realpath("JlSonic"))
|
|
using JlSonic
|
|
JlSonic.loadplaylists()
|
|
|
|
include("router.jl")
|
|
include("login.jl")
|
|
loadusers()
|
|
|
|
@app sonic = (
|
|
Mux.defaults,
|
|
restp("ping", _ -> ping()),
|
|
restp("getLicense", _ -> getLicense()),
|
|
mux(sonic_login,
|
|
branch(req -> req[:login][:login],
|
|
mux(dispatch, Mux.notfound())),
|
|
respond(auth_failed())),
|
|
)
|
|
if !isdefined(Main, :started)
|
|
serve(sonic)
|
|
started = true
|
|
end
|