aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/homepage.php
blob: 94fe4c933bf7ddb8928b73a6401561e307e70f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php

use Digitigrade\HttpResponseStatus\NotFound;
use Digitigrade\HttpResponseStatus\TemporaryRedirect;
use Digitigrade\Router;

Router::getInstance()->mount('/', function (array $args) {
    if (str_contains($_SERVER['HTTP_ACCEPT'] ?? '', 'text/html')) {
        throw new TemporaryRedirect(path_to_uri('/feed/global'));
    }
    throw new NotFound();
});