39 lines
3.2 KiB
HTML
Executable File
39 lines
3.2 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<script src="/scripts/Loader.js"></script>
|
|
<script src="/scripts/Assets.js"></script>
|
|
<script src="/scripts/User.js"></script>
|
|
<script src="/scripts/Router.js"></script>
|
|
<script src="/scripts/Logger.js"></script>
|
|
<script>
|
|
if(typeof(app)=='undefined') var app = {};
|
|
toplevel_routes =[
|
|
{'url': '!defaultroute', 'role': '*', 'ctrl' : '/common/defaultRoute', 'meth': 'err404' },
|
|
{'url': '/', 'role': '*', 'ctrl' : '/common/defaultRoute', 'meth': 'modulesChoice' },
|
|
{'url': '/', 'role': 'expert', 'ctrl' : '/common/defaultRoute', 'meth': 'ExpertmodulesChoice' },
|
|
{'url': '/app1', 'role': '*', 'ctrl' : '/app1/app1MainCtrl', 'meth': 'home' },
|
|
{'url': '/app1', 'role': '*', 'ctrl' : '/app1/app1MainCtrl' },
|
|
{'url': '/app1/user:uid', 'role': 'suckeleer', 'ctrl' : '/common/User/UserCtrl', 'meth': 'userDetails', 'params': {'extended':false} },
|
|
{'url': '/app1/user:uid', 'role': 'dikkenek', 'ctrl' : '/common/User/UserCtrl', 'meth': 'userDetails', 'params': {'extended':true} },
|
|
{'url': '/app1/user:uid(\\d+)', 'role': 'denbaas', 'ctrl' : '/common/User/UserCtrl', 'meth': 'userMod' },
|
|
{'url': '/app2', 'role': '*', 'ctrl' : '/app2/app2MainCtrl', },
|
|
{'url': '/app2/proposals', 'role': ['po','paco'], 'ctrl' : '/app2/app2proposalsCtrl', 'meth': 'list' },
|
|
{'url': '/app2/proposal:pid/reviews/:rid', 'role': ['paco'], 'ctrl' : '/app2/app2proposalsCtrl', 'meth': 'getOneReview' },
|
|
{'url': '/extapp/proposal:pid/reviews/:rid', 'role': ['expert'], 'exturl' : 'https://www.internike.com/printenv.php' },
|
|
{'url': '/crashtest', 'role': '*', 'ctrl' : '/app1/badscript', 'meth': 'modulesChoice' },
|
|
];
|
|
window.addEventListener('load', ()=>{
|
|
if(!app.hasOwnProperty('User')) app.User = new User();
|
|
if(!app.hasOwnProperty('Router')) app.Router = new Router(toplevel_routes, app.User.role, function(){ });
|
|
});
|
|
|
|
</script>
|
|
</head>
|
|
<body>
|
|
Application starting...
|
|
<a href="/app2"> click</a>
|
|
</body>
|
|
</html>
|