Updated documentation
This commit is contained in:
37
README.md
37
README.md
@ -2,15 +2,17 @@
|
||||
|
||||
HTTP server.
|
||||
|
||||
## Features
|
||||
|
||||
- Specificity based routing
|
||||
|
||||
## Installation
|
||||
|
||||
```shell
|
||||
go get git.akyoto.dev/go/server
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
Init:
|
||||
## Usage
|
||||
|
||||
```go
|
||||
s := server.New()
|
||||
@ -20,7 +22,7 @@ s := server.New()
|
||||
http.ListenAndServe(":8080", s)
|
||||
```
|
||||
|
||||
Static:
|
||||
### Static
|
||||
|
||||
```go
|
||||
s.Get("/", func(ctx server.Context) error {
|
||||
@ -28,7 +30,7 @@ s.Get("/", func(ctx server.Context) error {
|
||||
})
|
||||
```
|
||||
|
||||
Parameter:
|
||||
### Parameter
|
||||
|
||||
```go
|
||||
s.Get("/blog/:post", func(ctx server.Context) error {
|
||||
@ -36,10 +38,31 @@ s.Get("/blog/:post", func(ctx server.Context) error {
|
||||
})
|
||||
```
|
||||
|
||||
Wildcard:
|
||||
### Wildcard
|
||||
|
||||
```go
|
||||
s.Get("/images/*file", func(ctx server.Context) error {
|
||||
return ctx.String(ctx.Get("file"))
|
||||
})
|
||||
```
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```
|
||||
PASS: TestRouter
|
||||
PASS: TestPanic
|
||||
coverage: 100.0% of statements
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Please see the [license documentation](https://akyoto.dev/license).
|
||||
|
||||
## Copyright
|
||||
|
||||
© 2023 Eduard Urbach
|
||||
|
Reference in New Issue
Block a user