The bootstrap procedure must be done before the first start.
The bootstrap will create the various tables, the admin user, and the initial content of the platform, with the possibility to add replication for everything.main
parent
60989b17cd
commit
c6328bd174
|
@ -29,18 +29,6 @@ start(_Type, StartArgs) ->
|
|||
|
||||
{ok, Port} = application:get_env(port),
|
||||
|
||||
case storage:create(?APPBUCKET) of
|
||||
ok -> bootstrap(?APPBUCKET);
|
||||
{error, {already_exists, ?APPBUCKET, _}} -> ok;
|
||||
_ -> exit(blog_storage_init_failed)
|
||||
end,
|
||||
|
||||
case storage:create(?USERSBUCKET) of
|
||||
ok -> ok;
|
||||
{error, {already_exists, ?USERSBUCKET, _}} -> ok;
|
||||
_ -> exit(users_init_failed)
|
||||
end,
|
||||
|
||||
Dispatch = cowboy_router:compile([
|
||||
{'_', [{"/user", dudeswave_user_handler, #{bucket => ?USERSBUCKET}}]},
|
||||
{'_', [{"/", dudeswave_handler, #{bucket => ?APPBUCKET}}]}
|
||||
|
|
Loading…
Reference in New Issue