Skip to content

Commit e547071

Browse files
committed
Add static resource endpoint
1 parent ceab0cf commit e547071

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@
4343
"map": [
4444
[
4545
"pub/worker.php",
46+
"pub/worker.php"
47+
],
48+
[
49+
"pub/index.php",
4650
"pub/index.php"
51+
],
52+
[
53+
"pub/static.php",
54+
"pub/static.php"
4755
]
4856
]
4957
}

pub/index.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
$_SERVER['OPENGENTO_APP'] = \Opengento\Application\App\Http::class;
9+
10+
include 'worker.php';

pub/static.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
$_SERVER['OPENGENTO_APP'] = \Opengento\Application\App\StaticResource::class;
9+
10+
include 'worker.php';

pub/worker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
$handler = static function () use ($bootstrapPool): void {
3939
try {
4040
$bootstrap = $bootstrapPool->get();
41-
$app = $bootstrap->createApplication(\Opengento\Application\App\Application::class);
41+
$app = $bootstrap->createApplication($_SERVER['OPENGENTO_APP']);
4242
if ($app !== null) {
4343
$bootstrap->run($app);
4444
}

0 commit comments

Comments
 (0)