aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/homepage.php
blob: c147d67518aea9a967e1f467b3612b42672e7587 (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('/feed/global');
    }
    throw new NotFound();
});