aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.erl
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2025-11-12 00:23:20 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2025-11-12 00:23:20 -0300
commit19611409cfd2eb2b733705044d844aa2d19c5069 (patch)
tree5af7d5fef3faf6ea1086b96acb7f73c88b92d005 /src/main.erl
parent3063608df6ff1668f683d9d22c57fea29d728d0d (diff)
downloadSakura-19611409cfd2eb2b733705044d844aa2d19c5069.tar.gz
Sakura-19611409cfd2eb2b733705044d844aa2d19c5069.zip
fix startup crash
Diffstat (limited to 'src/main.erl')
-rw-r--r--src/main.erl29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/main.erl b/src/main.erl
index 3c34a31..5b8d6e3 100644
--- a/src/main.erl
+++ b/src/main.erl
@@ -1,7 +1,26 @@
-module(main).
--export([fibonacci/1]).
+-behaviour(application).
+
+-export([start/2, stop/1]).
+
+start(_StartType, _StartArgs) ->
+ %% Start Mnesia (or other children) here
+ io:format("Starting app...~n"),
+
+ %% Ensure Mnesia is started
+ mnesia:start(),
+
+ {ok, self()}.
+
+stop(_State) ->
+ io:format("Stopping app...~n"),
+ ok.
+
+%% setup() ->
+%% mnesia:create_table(attributes, [{type, set},
+%% {attributes, [name, value, type]},
+%% {ram_copies, [node()]},
+%% {index, [name]}
+%% ]).
+
-fibonacci(0) -> 0;
-fibonacci(1) -> 1;
-fibonacci(N) ->
- fibonacci(N-2) + fibonacci(N-1).