https://github.com/burdockcascade/hyperx
https://github.com/burdockcascade/hyperx
haxe http server
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/burdockcascade/hyperx
- Owner: burdockcascade
- License: mit
- Archived: true
- Created: 2024-05-02T22:31:03.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-05T20:56:36.000Z (over 1 year ago)
- Last Synced: 2025-03-11T04:32:44.079Z (about 1 year ago)
- Topics: haxe, http, server
- Language: Haxe
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hyper
## Description
Hyper is a simple HTTP server library for Haxe. It is designed to be simple and easy to use.
## Example
```haxe
import haxe.io.Bytes;
import hyper.Http.StatusCode;
import hyper.HyperServer;
class Example {
static function main() {
var server = new HyperServer();
server.setHostname("localhost");
server.setPort(80);
server.setHandler(new MyHandler());
server.start();
}
}
class MyHandler implements HttpRequestHandler {
var counter = 0;
public function new() {
}
public function handle(req:HttpRequest, res:HttpResponse) {
res.status = StatusCode.OK;
res.body = Bytes.ofString("Hello World! " + counter++);
}
}
```