Weblink
Linking Haxe to the role of a web server
Install / Use
/learn @PXshadow/WeblinkREADME
<p align="center">
<img alt="weblink" src="weblink.svg" height="180px" align="center" />
</p>
WebLink
Linking Hashlink to the role of a webserver.
class Main {
public static function main() {
var app = new weblink.Weblink();
app.get("/", function(request, response) {
response.send("HELLO WORLD");
});
app.listen(2000);
}
}
Features
- Uses libuv
- Minimal and concise with express lib in mind
- No dependencies, and easy integration
- Extremely fast, roughly 4x faster than Fastify with big data, and 2x with small Benchmark
Getting Started
Install dev version:
haxelib git weblink https://github.com/PXshadow/weblink
Include in build.hxml
-lib weblink
Targets
- requires nightly haxe version
- requires libuv
- hashlink (uses libuv)
Benchmark
<p align="left"><img src ="benchmark.png"></p>
Supported
- methods
- [x] GET
- [x] POST
- [ ] OPTIONS
- [x] HEAD
- [x] PUT
- encoding
- [ ] gzip
- [ ] compress
- [x] deflate
- [ ] br
- caching
- [ ] age
- [ ] expires
- security
- extra
- [x] content type
- [x] bytes (png image for instance)
- [x] redirects
- [x] serve web content (files ex: html/images/sounds)
- [ ] connection public ip (haxe 4.2)
- [x] projection (a type with certain attributes of another type, useful to send only some data)
Contributing
- Fork
- Clone and setup
- Create a pull request with your changes
