This repository has been archived by the owner on Feb 13, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
602ca58
commit 3c0b351
Showing
5 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
require_once __DIR__ . '/../../vendor/autoload.php'; | ||
<?php declare(strict_types=1); | ||
|
||
use Siler\Route; | ||
use Siler\Swoole; | ||
use Siler\Twig; | ||
|
||
require_once __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
Twig\init(__DIR__ . '/pages'); | ||
|
||
$server = function () { | ||
$handler = function () { | ||
Route\get('/', __DIR__ . '/pages/home.php'); | ||
Route\get('/todos', __DIR__ . '/api/todos.php'); | ||
|
||
// None of the above short-circuited the response with Swoole\emit(). | ||
Swoole\emit('Not found', 404); | ||
}; | ||
|
||
Swoole\http($server)->start(); | ||
$server = Swoole\http($handler); | ||
$server->set([ | ||
'enable_static_handler' => true, | ||
'document_root' => __DIR__ . '/public', | ||
]); | ||
$server->start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Siler + Swoole</title> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Siler + Swoole</title> | ||
<link rel="stylesheet" href="/assets/styles.css"> | ||
<script defer src="/assets/scripts.js"></script> | ||
</head> | ||
<body> | ||
{% block page %}{% endblock %} | ||
{% block page %}{% endblock %} | ||
</body> | ||
</html> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('Siler ❤️ Swoole') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
p { | ||
color: pink; | ||
} |