DirektiveDesDons/index.php

25 lines
534 B
PHP
Raw Normal View History

2022-12-08 14:26:04 +01:00
<?php
2022-12-08 14:43:05 +01:00
require_once("Router/Router.php");
require_once("Router/Response.php");
2022-12-21 10:14:44 +01:00
require_once("BancaDati/BancaDati.php");
2022-12-08 14:43:05 +01:00
use Router\Response;
use Router\Router;
2022-12-21 10:14:44 +01:00
use BancaDati\BancaDati;
2022-12-08 14:43:05 +01:00
$app = new Router("/DirektiveDesDons");
$app->get("/", function (array $req, Response $res) {
$res->send("Hello World");
});
2022-12-08 14:52:20 +01:00
$app->get("/user", function (array $req, Response $res) {
$res->send("user");
});
2022-12-21 10:14:44 +01:00
$app->get("/user/:id", function (array $req, Response $res) {
$res->send("user " . $req["params"]["id"]);
});
2022-12-08 14:52:20 +01:00
2022-12-08 14:43:05 +01:00
$app->start();