DirektiveDesDons/index.php
Johannes Kantz 05e3cf9553 add: use DB
2022-12-21 10:26:12 +01:00

26 lines
557 B
PHP

<?php
require_once("Router/Router.php");
require_once("Router/Response.php");
require_once("BancaDati/BancaDati.php");
use Router\Response;
use Router\Router;
use BancaDati\BancaDati;
$app = new Router("/DirektiveDesDons");
$db = new BancaDati();
$app->get("/", function (array $req, Response $res) {
$res->send("Hello World");
});
$app->get("/user", function (array $req, Response $res) {
$res->send("user");
});
$app->get("/user/:id", function (array $req, Response $res) {
$res->send("user " . $req["params"]["id"]);
});
$app->start();