Skip to content

Commit b47b88b

Browse files
authored
Improve documentation
1 parent 28b0027 commit b47b88b

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
# http-server-static-content
22

3-
This package provides a static content `RequestHandler` implementations for the [AMPHP HTTP server](https://github.com/amphp/http-server).
3+
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind. This package provides an [HTTP server](https://amphp.org/http-server) plugin to serve static files like HTML, CSS, JavaScript, and images effortlessly.
4+
5+
## Installation
6+
7+
This package can be installed as a [Composer](https://getcomposer.org/) dependency.
8+
9+
```bash
10+
composer require amphp/http-server-static-content
11+
```
412

513
## Usage
614

7-
**`DocumentRoot`** and **`StaticResource`** implement `RequestHandler`.
15+
This package provides two `RequestHandler` implementations:
16+
- **`DocumentRoot`**: Serves all files within a directory.
17+
- **`StaticResource`**: Serves a single specific file.
818

9-
## Example
19+
The example below combines static file serving and [request routing](https://amphp.org/http-server-router) to demonstrate how they work well together:
1020

1121
```php
1222
<?php
@@ -26,4 +36,16 @@ $router->addRoute('GET', '/', new ClosureRequestHandler(function () {
2636

2737

2838
$server->start($router, new DefaultErrorHandler());
29-
```
39+
```
40+
41+
## Contributing
42+
43+
Please read [our rules](https://amphp.org/contributing) for details on our code of conduct, and the process for submitting pull requests to us.
44+
45+
## Security
46+
47+
If you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker.
48+
49+
## License
50+
51+
The MIT License (MIT). Please see [LICENSE](./LICENSE) for more information.

0 commit comments

Comments
 (0)