-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
62 lines (45 loc) · 2.11 KB
/
Copy pathindex.php
File metadata and controls
62 lines (45 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
// Load the composer required libraries
require "vendor/autoload.php";
// Load the framework
$f3 = Base::instance();
$f3->config("config.ini");
// Database connection information
$f3->config("access.ini");
// Routes
// index.html
$f3->route("GET @home: /", "LoginController->render");
$f3->route("POST @home", "LoginController->login");
$f3->route("GET @register: /register", "RegisterController->render");
$f3->route("POST @register", "RegisterController->register");
// contact-us.html
$f3->route("GET @contactUs: /contact-us", "ContactUsController->contactUs");
// app.html
$f3->route("GET @app: /app", "AppController->render");
// List modes
$f3->route("GET @appListMode: /app/list/mode/@mode", "AppController->setMode");
$f3->route("GET @appListPriority: /app/list/priority", "AppController->setByPriority");
$f3->route("GET @appListDueDate: /app/list/dueDate", "AppController->setByDueDate");
// Lists
$f3->route("POST @rootList: /app/list", "ListController->create");
$f3->route("POST @editListTitle: /app/list/editTitle", "ListController->editTitle");
$f3->route("GET @getList: /app/list/@id", "AppController->setList");
$f3->route("DELETE @getList", "ListController->delete");
$f3->route("GET @updateListOrder: /app/list/@id/@order", "ListController->updateListOrder");
// Tasks
$f3->route("GET @rootTask: /app/task", null);
$f3->route("POST @rootTask", "TaskController->createTask");
$f3->route("GET @getTask: /app/task/@id", "TaskController->getTask");
$f3->route("POST @getTask", "TaskController->updateTask");
$f3->route("DELETE @getTask", "TaskController->deleteTask");
$f3->route("GET @toggleTask: /app/task/@id/toggle", "TaskController->toggleTask");
// Profile update and delete routes
$f3->route("GET @profile: /profile", "ProfileController->render");
$f3->route("POST @profileUpdate: /update", "ProfileController->update");
$f3->route("GET @profileDelete: /delete", "ProfileController->delete");
$f3->route("GET @logout: /logout", "Controller->logout");
// Catch invalid url, redirect to home
/*$f3->route("GET /*", "LoginController->render");
$f3->route("POST /*", "LoginController->render");*/
// Start
$f3->run();