trax

Native web framework for Haxe
https://github.com/coolfren/Trax

To install, run:

haxelib install trax 0.0.1 

See using Haxelib in Haxelib documentation for more information.

README.md

Trax

Trax is a web framework for Haxe similar to Express.

This project is still work in progress. Expect missing features and bugs. (Pull requests are always welcome!)

TODO

  • [x] Implement middleware
  • [x] Implement parsing of GET parameters and POST bodies (partially)
  • [ ] More features

Example

package;

import trax.Middleware;
import trax.Router;

class Main {
  static function main() {
    final address = "127.0.0.1";
    final port = 3000;

    final app = new Router(address, ()->{
      trace('Server is listening on http://$address:$port/');
    });

    app.get("/", (req, res)->{
      res.send("Hello World!\n");
      res.send("Your Useragent: " + req.headers.get("User-Agent") + "\n");
      if(req.body.foo == "bar")
        res.send("foobar!");
    });

    app.listen(port);
  }
}
Contributors
coolfren
Version
0.0.1
Published
2 years ago
License
GPL

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub