25 lines
534 B
PHP
25 lines
534 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");
|
|
|
|
|
|
$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(); |