Packages

A high-performance, analytical Datalog engine for Gleam

Current section

Files

Jump to
aarondb src aarondb@gleamcms.erl
Raw

src/aarondb@gleamcms.erl

-module(aarondb@gleamcms).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/aarondb/gleamcms.gleam").
-export([main/0]).
-file("src/aarondb/gleamcms.gleam", 10).
-spec main() -> nil.
main() ->
logging_ffi:configure(),
Db = aarondb:new(),
aarondb@gleamcms@db@schema:init_schema(Db),
_ = aarondb@gleamcms@builder@importer:run_import(
Db,
<<"legacy_posts.json"/utf8>>
),
Secret_key_base = <<"fake_secret_key_base_for_local_dev"/utf8>>,
case begin
_pipe = wisp@wisp_mist:handler(
fun(_capture) ->
aarondb@gleamcms@server@router:handle_request(_capture, Db)
end,
Secret_key_base
),
_pipe@1 = mist:new(_pipe),
_pipe@2 = mist:port(_pipe@1, 4000),
mist:start(_pipe@2)
end of
{ok, _} -> nil;
_assert_fail ->
erlang:error(#{gleam_error => let_assert,
message => <<"Pattern match failed, no pattern matched the value."/utf8>>,
file => <<?FILEPATH/utf8>>,
module => <<"aarondb/gleamcms"/utf8>>,
function => <<"main"/utf8>>,
line => 24,
value => _assert_fail,
start => 566,
'end' => 718,
pattern_start => 577,
pattern_end => 582})
end,
gleam_erlang_ffi:sleep_forever().