From 95d1b9428f3fc97f92c463c50c2afd17a5b5444e Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 22 Nov 2023 16:33:01 +0100 Subject: enhance local testing --- .gitignore | 2 ++ Justfile | 9 +++++++++ test/index.php | 3 +++ test/router.php | 3 --- test/server.php | 16 ++++++++++++++++ 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 Justfile create mode 100644 test/index.php delete mode 100644 test/router.php create mode 100644 test/server.php diff --git a/.gitignore b/.gitignore index 2879d3b..5dcff68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /vendor/ +/test/cert.pem +/test/key.rsa .env diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..2c75d5f --- /dev/null +++ b/Justfile @@ -0,0 +1,9 @@ +test: + GEMINI_HOST=localhost php -S localhost:8080 -t test test/index.php + + +server: + php test/server.php + +cert-server: + openssl req -x509 -newkey rsa:4096 -keyout test/key.rsa -out test/cert.pem -days 3650 -nodes -subj "/CN=localhost" diff --git a/test/index.php b/test/index.php new file mode 100644 index 0000000..cead5ee --- /dev/null +++ b/test/index.php @@ -0,0 +1,3 @@ + __DIR__ . '/cert.pem', + 'key' => __DIR__ . '/key.rsa', + 'passphrase' => '', +]); + +$server->onRequest(new DocumentServer(__DIR__)); + +$server->listen(); -- cgit v1.2.3