summaryrefslogtreecommitdiff
path: root/test/server.php
blob: adc9d0540b3d29c03981c7135cdbe42519781846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?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(
  documentRoot: __DIR__,
  useDirectoryListing: true
));

$server->listen();