26 lines
557 B
PHP
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(); |