Download web/public/index.php from datamatters24/research-document-archive: direct link, hf CLI and curl.
- Browser
- Download file 2.07 kB
-
https://huggingface.co/datamatters24/research-document-archive/resolve/main/web/public/index.php
- Command line
-
hf download hf://datamatters24/research-document-archive/web/public/index.php
-
curl -L -o index.php https://huggingface.co/datamatters24/research-document-archive/resolve/main/web/public/index.php
2.07 kB
| declare(strict_types=1); | |
| // --------------------------------------------------------------------------- | |
| // Front Controller | |
| // --------------------------------------------------------------------------- | |
| require_once __DIR__ . '/../src/bootstrap.php'; | |
| // Apply security headers on every request | |
| Security::applyHeaders(); | |
| // --------------------------------------------------------------------------- | |
| // Route definitions | |
| // --------------------------------------------------------------------------- | |
| $router = new Router(); | |
| // Pages | |
| $router->get('/', ['HomeController', 'index']); | |
| $router->get('/browse', ['BrowseController', 'index']); | |
| $router->get('/browse/{collection}', ['BrowseController', 'collection']); | |
| $router->get('/document/{id}', ['DocumentController', 'show']); | |
| $router->get('/search', ['SearchController', 'index']); | |
| $router->get('/similar/{pageId}', ['SemanticController', 'similar']); | |
| $router->get('/timeline', ['TimelineController', 'index']); | |
| $router->get('/crisis/{id}', ['CrisisController', 'show']); | |
| $router->get('/network', ['NetworkController', 'index']); | |
| $router->get('/dashboard', ['DashboardController', 'index']); | |
| $router->get('/pdf/{id}', ['PdfController', 'stream']); | |
| // API (JSON) | |
| $router->get('/api/search', ['ApiController', 'search']); | |
| $router->get('/api/page/{docId}/{pageNum}', ['ApiController', 'pageText']); | |
| $router->get('/api/stats', ['ApiController', 'stats']); | |
| $router->get('/api/events', ['ApiController', 'events']); | |
| $router->get('/api/document/{id}/events', ['ApiController', 'documentEvents']); | |
| // --------------------------------------------------------------------------- | |
| // Dispatch | |
| // --------------------------------------------------------------------------- | |
| $uri = $_SERVER['REQUEST_URI'] ?? '/'; | |
| $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; | |
| $router->dispatch($uri, $method); | |