summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Justfile9
-rw-r--r--test/index.php (renamed from test/router.php)0
-rw-r--r--test/server.php16
4 files changed, 27 insertions, 0 deletions
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/router.php b/test/index.php
index cead5ee..cead5ee 100644
--- a/test/router.php
+++ b/test/index.php
diff --git a/test/server.php b/test/server.php
new file mode 100644
index 0000000..ec2a86a
--- /dev/null
+++ b/test/server.php
@@ -0,0 +1,16 @@
+<?php
+
+use GeminiFoundation\Server;
+use GeminiFoundation\Server\RequestHandlers\DocumentServer;
+
+require dirname(__DIR__) . '/vendor/autoload.php';
+
+$server = new Server([
+ 'file' => __DIR__ . '/cert.pem',
+ 'key' => __DIR__ . '/key.rsa',
+ 'passphrase' => '',
+]);
+
+$server->onRequest(new DocumentServer(__DIR__));
+
+$server->listen();