@@ -18,7 +18,7 @@ JSON Response:
1818 "nightly_released: "2023-09-21"
1919 }
2020
21- ### api.phpmyfaq.de/verify/& lt ; version& gt ;
21+ ### api.phpmyfaq.de/verify/< version >
2222
2323JSON Response:
2424
@@ -64,3 +64,40 @@ Requests:
6464Mozilla Public License 2.0, see LICENSE.md for more information.
6565
6666Copyright © 2014-2023 Thorsten Rinne
67+
68+
69+ <!-- Added: Symfony-like lightweight front controller + routing -->
70+
71+ ## Lightweight Symfony-based front controller
72+
73+ - Front controller: ` public/index.php ` using ` symfony/http-foundation ` and ` symfony/routing ` .
74+ - Controller: ` src/Controller/ApiController.php ` implements all endpoints.
75+ - Apache rewrites: root ` .htaccess ` forwards all requests to ` public/ ` , and ` public/.htaccess ` routes to the front controller.
76+ - CORS support: default ` Access-Control-* ` headers and ` OPTIONS ` preflight handling.
77+
78+ ### Requirements
79+ - PHP >= 8.2
80+
81+ ### Local run
82+ Install deps and start a local server:
83+
84+ ``` bash
85+ composer install
86+ composer serve
87+ # or
88+ php -S 127.0.0.1:3000 -t public public/index.php
89+ ```
90+
91+ Try:
92+
93+ ``` bash
94+ curl http://127.0.0.1:3000/
95+ curl http://127.0.0.1:3000/versions
96+ curl http://127.0.0.1:3000/version/stable
97+ curl " http://127.0.0.1:3000/verify/2.8.18"
98+ ```
99+
100+ ### Notes
101+ - Nightly value is generated as ` nightly-<yesterday> ` ; its release date equals yesterday.
102+ - ` verify ` responds with 418 for missing or invalid versions.
103+ - CORS headers are always present; ` OPTIONS ` returns 204.
0 commit comments