An open API service indexing awesome lists of open source software.

https://github.com/nazg-hack/http-server-request-handler

HTTP Server Request Handler Interfaces For Hack
https://github.com/nazg-hack/http-server-request-handler

hacklang hhvm interfaces middleware-pipeline request-handler

Last synced: 10 days ago
JSON representation

HTTP Server Request Handler Interfaces For Hack

Awesome Lists containing this project

README

          

# HTTP Server Request Handlers

PSR-15 Like HTTP Server Request Handlers Interface For Hack

## Require

HHVM 3.30.0 and above.
required [hsl-experimental](https://github.com/hhvm/hsl-experimental)

## Install

```bash
$ hhvm $(which composer) require nazg/http-server-request-handler
```

## Usage

Golang style

```go
func middleware(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
log.Printf("Hello World, %s", r.RequestURI)
next.ServeHTTP(w, r)
}
}
```

For Hack

```hack
handle($write, $request);
}
}
```