Paperyard
routes.php
Go to the documentation of this file.
1 <?php
2 
5 
6 // Routes
7 
8 $app->get('/', Paperyard\Controllers\Misc\Index::class);
9 
10 $app->get('/archive[{path:.*}]', Paperyard\Controllers\Archive\Archive::class);
11 
12 $app->get('/doc/{path}', \Paperyard\Controllers\Archive\Details::class);
13 
14 $app->get('/thumbnail/{path}/{page}[/{resolution}]', \Paperyard\Controllers\Misc\Thumbnail::class);
15 
16 $app->post('/setlang', function (Request $request, Response $response, array $args) {
17  $langCode = $request->getParsedBody()['code'];
18  $supportedCodes = array_map(function ($code) { return basename($code); }, glob("../locale/*", GLOB_ONLYDIR));
19  if (in_array($langCode, $supportedCodes)) {
20  $_SESSION["lang-code"] = $langCode;
21  return $response;
22  }
23  return $response->withStatus(406);
24 });
25 
26 $app->post('/upload', Paperyard\Controllers\Misc\Upload::class);
27 
28 include 'confirm.archive.router.php';
29 
30 include "senders.rules.router.php";
31 
32 include "recipients.rules.router.php";
33 
34 include "subjects.rules.router.php";
35 
36 include "archive.rules.router.php";
37 
38 include "log.shell.router.php";
$app
Definition: index.php:18