Skip to content

Commit c6ad8e4

Browse files
committed
wip
1 parent 8563867 commit c6ad8e4

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Caddyfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
frankenphp {
3+
worker {
4+
file /app/public/index.php
5+
watch
6+
}
7+
}
8+
}

packages/router/src/Commands/ServeCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public function __invoke(
4242

4343
private function worker(string $host, int $port, int $httpsPort, string $publicDir): void
4444
{
45-
$this->success('Listening on http://' . $host . ':' . $port . ', https://' . $host . ':' . $httpsPort);
46-
4745
$command = sprintf(<<<'SH'
4846
docker run \
4947
-e FRANKENPHP_CONFIG="worker %s" \
@@ -57,6 +55,8 @@ private function worker(string $host, int $port, int $httpsPort, string $publicD
5755
$httpsPort
5856
);
5957

58+
$this->info('Listening on http://' . $host . ':' . $port . ', https://' . $host . ':' . $httpsPort);
59+
6060
$this->info($command);
6161

6262
passthru($command);

public/index.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66

77
require_once __DIR__ . '/../vendor/autoload.php';
88

9+
$discoveryLocations = [
10+
new DiscoveryLocation('Tests\\Tempest\\Fixtures\\', __DIR__ . '/../tests/Fixtures/'),
11+
];
12+
913
if (function_exists('frankenphp_handle_request')) {
1014
ignore_user_abort(true);
1115

12-
$application = WorkerApplication::boot(__DIR__ . '/../');
16+
$application = WorkerApplication::boot(__DIR__ . '/../', discoveryLocations: $discoveryLocations);
1317

1418
$handler = static function () use ($application) {
1519
$application->run();
@@ -25,9 +29,7 @@
2529
if (! $keepRunning) break;
2630
}
2731
} else {
28-
HttpApplication::boot(__DIR__ . '/../', discoveryLocations: [
29-
new DiscoveryLocation('Tests\\Tempest\\Fixtures\\', __DIR__ . '/../tests/Fixtures/'),
30-
])->run();
32+
HttpApplication::boot(__DIR__ . '/../', discoveryLocations: $discoveryLocations)->run();
3133

3234
exit();
3335

0 commit comments

Comments
 (0)