Using JSON data in UFront

44 views
Skip to first unread message

Confidant

unread,
Jun 24, 2016, 1:18:01 PM6/24/16
to Haxe
In UFront I want to use a static JSON file server-side like it's a database. Any suggestions as to the preferred functions to use in reading/parsing the file prior to returning a dynamic ViewResult? I plan on setting it up as an API (like in this remoting example) and returning a surprise after the data is read. If it were clientside-only I'd be using haxe.Http but is there a better Ufront way?

Confidant

unread,
Jun 24, 2016, 4:08:04 PM6/24/16
to Haxe
Looks like sys.io.File will be the way to go.

Jason O'Neil

unread,
Jun 24, 2016, 9:31:11 PM6/24/16
to haxe...@googlegroups.com
Yes when it comes to interacting with the server FileSystem in a Ufront project, just use whatever is "native" for the target platform.  If you're using PHP or Neko on the server then go with the `sys.io.File` API.  If you're using NodeJS then probably the `Fs` API.

Good luck!

On Sat, Jun 25, 2016 at 6:08 AM, Confidant <alter...@gmail.com> wrote:
Looks like sys.io.File will be the way to go.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Juraj Kirchheim

unread,
Jun 25, 2016, 4:28:59 AM6/25/16
to haxe...@googlegroups.com
Or you can use this: https://github.com/benmerckx/asys
Reply all
Reply to author
Forward
0 new messages