Skip to content

coolfren/Trax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Implement middleware
  • 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);
  }
}

About

Native web framework for Haxe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages