summaryrefslogtreecommitdiff
path: root/test/server.php
blob: 2268d148bb7f22e25a0a213f2039553bffa5b36e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?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' => '',
  ],
  '0.0.0.0'
);

$server->onRequest(new DocumentServer(
  documentRoot: __DIR__,
  useDirectoryListing: true
));

$server->listen();