https://github.com/tong/wtri
Haxe/Sys web server
https://github.com/tong/wtri
hashlink haxe http server sys webserver
Last synced: about 1 month ago
JSON representation
Haxe/Sys web server
- Host: GitHub
- URL: https://github.com/tong/wtri
- Owner: tong
- Created: 2013-01-12T12:53:52.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2024-06-12T08:19:39.000Z (over 1 year ago)
- Last Synced: 2024-12-29T11:44:47.353Z (about 1 year ago)
- Topics: hashlink, haxe, http, server, sys, webserver
- Language: Haxe
- Homepage:
- Size: 504 KB
- Stars: 40
- Watchers: 8
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WTRI
Embeddable haxe/sys web server.
## Usage
```hx
new wtri.Server((req,res)-> {
Sys.println(req.path);
res.end('Hello!');
}).listen(8080);
```
See: [Wtri.hx](https://github.com/tong/wtri/blob/master/src/Wtri.hx)
## Build
Clone and install dependencies:
```sh
git clone https://github.com/tong/wtri.git
cd wtri/
haxelib install haxelib.json
haxelib dev wtri .
```
Build for various targets:
```sh
haxe wtri.hxml -hl wtri.hl
haxe wtri.hxml -hl out/main.c -D hlgen.makefile=make
haxe wtri.hxml -neko wtri.n
haxe wtri.hxml -cpp cpp
haxe wtri.hxml -python wtri.py
haxe wtri.hxml -lua wtri.lua -D lua-vanilla -D lua-jit
haxe wtri.hxml --jvm wtri.jar
```
## Run
```sh
wtri --help
Usage: wtri [options]
[--host] : Address to bind
[--port] : Port to bind
[--root] : File system root
[--deflate] : Enable deflate content encoding
[--uv] : Use libuv (hl)
[--hscript] : Enable hcript handler
[--quiet] : Disable logging to stdout
[--help] : Print this help
```
Run directly as an initialization macro:
```sh
haxe -lib wtri --macro 'Wtri.start(8080)'
```
[](https://github.com/tong/wtri/actions/workflows/build.yml)