jdecool/scaleway-runtimepublic Fork
⑂ 80a8c50
Commits
⬇ Clone ▾
git clone https://git.rickub.com/jdecool/scaleway-runtime.git
git clone ssh://git@rickub.com/jdecool/scaleway-runtime.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

docs(example): mention Front Controllers returning a raw callableUnverified

Jérémy DECOOL committed 2026-11-14T02:12:10+01:00 Browse files
80a8c50 parent: f833a3d
modified example/README.md +10 -0
@@ -23,6 +23,16 @@ Select it with the `front_controller` runtime option, for instance `APP_RUNTIME_
2323 A Front Controller may also return a PSR-15 `RequestHandlerInterface`, built once and reused like the Kernel, once the application requires `symfony/psr-http-message-bridge` and `nyholm/psr7`.
2424 Its PSR-7 request sees the client, scheme and host resolved from the platform's `X-Forwarded-*` headers, in `getUri()` as in the `REMOTE_ADDR`, `HTTPS` and `HTTP_HOST` server params.
2525
26+A Front Controller whose closure returns another `Closure` talks to Scaleway without any translation: that raw callable, built once and reused like the Kernel, receives every Event and context as they are, CRON Invocations included, and returns the Function Response itself.
27+
28+```php
29+return static fn (): Closure => static fn (array $event, mixed $context): array => [
30+ 'statusCode' => 200,
31+ 'headers' => ['Content-Type' => 'text/plain'],
32+ 'body' => 'Hello from '.($event['path'] ?? '/'),
33+];
34+```
35+
2636 ## Run it locally
2737
2838 ```sh
@@ -23,6 +23,16 @@ Select it with the `front_controller` runtime option, for instance `APP_RUNTIME_
23 A Front Controller may also return a PSR-15 `RequestHandlerInterface`, built once and reused like the Kernel, once the application requires `symfony/psr-http-message-bridge` and `nyholm/psr7`.23 A Front Controller may also return a PSR-15 `RequestHandlerInterface`, built once and reused like the Kernel, once the application requires `symfony/psr-http-message-bridge` and `nyholm/psr7`.
24 Its PSR-7 request sees the client, scheme and host resolved from the platform's `X-Forwarded-*` headers, in `getUri()` as in the `REMOTE_ADDR`, `HTTPS` and `HTTP_HOST` server params.24 Its PSR-7 request sees the client, scheme and host resolved from the platform's `X-Forwarded-*` headers, in `getUri()` as in the `REMOTE_ADDR`, `HTTPS` and `HTTP_HOST` server params.
25 25
26+A Front Controller whose closure returns another `Closure` talks to Scaleway without any translation: that raw callable, built once and reused like the Kernel, receives every Event and context as they are, CRON Invocations included, and returns the Function Response itself.
27+
28+```php
29+return static fn (): Closure => static fn (array $event, mixed $context): array => [
30+ 'statusCode' => 200,
31+ 'headers' => ['Content-Type' => 'text/plain'],
32+ 'body' => 'Hello from '.($event['path'] ?? '/'),
33+];
34+```
35+
26 ## Run it locally36 ## Run it locally
27 37
28 ```sh38 ```sh