22 <img alt="weblink" src="weblink.svg" height="180px" align="center" />
33</p >
44
5- WebLink
5+ WebLink Version 2
66======
77Linking [ Hashlink] ( https://github.com/HaxeFoundation/hashlink ) and other [ targets] ( #targets ) to the role of a webserver.
88
99``` haxe
10- class Main {
11- function main() {
12- var app = new weblink.Weblink();
13- app.get(function(request,response)
14- {
15- response.send("HELLO WORLD");
16- });
17- app.listen(2000);
18- }
10+ function main() {
11+ var app = new weblink.Weblink();
12+ app.get(function(request,response)
13+ {
14+ response.send("HELLO WORLD");
15+ });
16+ app.listen(2000);
1917}
2018```
2119
2220Features
2321====
24- * Uses [ libuv] ( https://github.com/libuv/libuv )
25- * Minimal and concise with express lib in mind
26- * No dependencies, and easy integration
27- * Extremely fast, roughly 4x faster than Fastify with big data, and 2x with small [ Benchmark] ( #benchmark )
22+ * Uses [ net/http] ( https://pkg.go.dev/net/http ) from Go compiled into Haxe using [ go2hx] ( https://github.com/go2hx/go2hx ) .
23+ * Minimal and concise with express library in mind.
24+ * No dependencies, and easy integration.
2825
2926
3027Getting Started
3128====
3229
3330Install dev version:
3431```
35- haxelib git weblink https://github.com/PXshadow/weblink
32+ haxelib git weblink https://github.com/PXshadow/weblink v2
3633```
3734Include in build.hxml
3835```
3936-lib weblink
4037```
4138
4239# Targets
43- * requires libuv (asys in the future)*
44- * hashlink (uses libuv)
45- * more targets in the future using [ asys] ( https://github.com/HaxeFoundation/haxe-evolution/blob/7371439061fcb30f60f21369701a5e599dfa802c/proposals/0010-asys.md )
40+ * hashlink
41+ * interp maybe
4642
4743# Benchmark
4844
49- [ <p align =" left " ><img src =" benchmark.png " ></p >] ( https://github.com/PXshadow/weblinkBenchmark )
50-
5145Supported
5246====
5347- [ methods] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods )
@@ -57,13 +51,9 @@ Supported
5751 - [x] HEAD
5852 - [x] PUT
5953- [ encoding] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Compression )
60- - [ ] gzip
61- - [ ] compress
62- - [x] deflate
63- - [ ] br
54+ - automatically handled
6455- caching
65- - [ ] age
66- - [ ] expires
56+ - automatically handled by last modified using file server
6757- security
6858 - [x] [ cookies] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies )
6959 - [ ] [ cors] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS )
@@ -82,47 +72,11 @@ Supported
8272 - [x] bytes (png image for instance)
8373 - [x] [ redirects] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections )
8474 - [x] serve web content (files ex: html/images/sounds)
85- - [ ] connection public ip (haxe 4.2)
8675 - [x] projection (a type with certain attributes of another type, useful to send only some data)
8776
8877# Contributing
8978
90791 . Fork
91802 . Clone and setup
92- 3 . Configure VSCode :
93-
94- Add that in .vscode/launch.json :
95-
96- ```
97- {
98- // Use IntelliSense to learn about possible attributes.
99- // Hover to view descriptions of existing attributes.
100- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
101- "version": "0.2.0",
102- "configurations": [
103- {
104- "name": "HashLink (launch)",
105- "request": "launch",
106- "type": "hl",
107- "cwd": "${workspaceFolder}",
108- "preLaunchTask": {
109- "type": "haxe",
110- "args": "active configuration"
111- }
112- },
113- {
114- "name": "HashLink (attach)",
115- "request": "attach",
116- "port": 6112,
117- "type": "hl",
118- "cwd": "${workspaceFolder}",
119- "preLaunchTask": {
120- "type": "haxe",
121- "args": "active configuration"
122- }
123- }
124- ]
125- }
126- ```
127- 4. Develop (and press F5 to launch hashlink)
81+ 4 . Make changes and run, tests.hxml and hl test.hl
128825 . Pull request
0 commit comments