-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
32 lines (26 loc) · 893 Bytes
/
index.php
File metadata and controls
32 lines (26 loc) · 893 Bytes
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
<?php
/**
* This file is part of Medict https://github.com/biusante/medict
* Copyright (c) 2021 Université Paris Cité / Bibliothèques / Histoire de la santé
*/
/** router */
declare(strict_types=1);
// Change this path if app is in another folder
$appdir = __DIR__ . "/";
// load the master class of the app
require_once($appdir . "Medict.php");
use Oeuvres\Kit\{Route};
// data servlets, no template
Route::get('/data/(.*)', $appdir . 'data/$1.php', null, null);
// register templates
Route::template($appdir . 'tmpl_doc.php', 'doc');
// welcome page
Route::get('/', $appdir . 'pages/desk.php');
// try if a php content is available
Route::get('/(.*)', $appdir . 'pages/$1.php');
// try if an html content is available
Route::get('/(.*)', $appdir . 'pages/$1.html');
// catch all
Route::route('/404', $appdir . 'pages/404.html');
// No Route has worked
echo "Bad routage, 404.";