Run project with docker compose
[asis23-votoe-client.git] / scripts / main.js
blobc44ef096e52aed0b1df723f1c9cb7a06700cb2d7
1 // https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
2 window.onload = (event) => {
3 // Instantiate modules
4 let restapi = new RestApi(config.restapi.host, config.restapi.port);
5 let admin = new Admin(restapi);
6 let vote = new Vote(restapi);
7 let report = new Report(restapi);
8 let menu = new Menu();
10 // Initialize modules
11 menu.ondisplay("admin", (section) => {
12 admin.init(section);
13 });
14 menu.ondisplay("vote", (section) => {
15 vote.init(section);
16 });
17 menu.ondisplay("report", (section) => {
18 report.init(section);
19 });