A simple example of Ufront running on the client and the server.
For help understanding the example, you can ask our community on one of our community channels like gitter.
This example is intentionally small, it shows off:
- Setting up an app to run on both the server and the client.
- Using a controller to respond to link clicks and form submits.
- Returning a ViewResult using the built in
haxe.Template
templating system.
There's obviously a lot more to Ufront, but this is supposed to be a very simple example.
We'll try make the example viewable online soon.
Currently you need to use the development version of haxelib, so these instructions are a little longer than normal. This will be simplified when we release a new haxelib version.
# Install the Ufront libraries and dependencies
haxelib install ufront
haxelib install ufront-client
# Clone and set up the development version of Ufront
git clone --recursive https://github.com/ufront/ufront.git
cd ufront
./setupDev
# Setup ufront shortcut
haxelib run ufront --setup
# Build both "server.hxml" and "client.hxml"
cd submodules/hello
ufront build # Or shorter, `ufront b`
# To test neko, run a temporary server:
ufront server # Or shorter, `ufront s`
# Run a temporary server (PHP)
cd www
php -S localhost:2987
# To run the NodeJS server:
cd www
node server.js
This has been tested and works server side with:
- Server-side:
- PHP
- Neko
- JS (Node)
- Client-side:
- JS (Browser)
All testing is done with Haxe 3.2.
Please report bugs here: https://github.com/ufront/hello/issues
If you have general Ufront support questions, post to Stack Overflow and tag the question ufront
.
Pull requests and contributions welcome:
- For the code, if you have an improvement, or a bug fix.
- For the comments in the code - if something is confusing and could do with some comments to explain what is going on.
- For this README and/or any other documentation.
If anyone provides a good pull request and shows they're trustworthy, I'm happy to give commit access too!