What's the simplest way to use INI files in WEB Core?

An app I'm building needs to be able to access some data from JSON or INI files when the user selects various options. For a typical VCL app, the answer is simple. However, for a WEB Core app, I don't want to have to build and host an XData service just to support something this simple.

It seems like there should be something relatively simple that we can use to implement basic INI file functionality for WEB Core apps.

What are our options? Crazy, not crazy, whatever. Just anything other than having to set up something like an XData service on a Win host. Brainstorm away!

Maybe somebody has built a simple file service in PHP that can be used to easily support INI and JSON files in a Linux environment for basic needs?

A web app can't open local files for security reasons but you van use local storage which is private to your app e.g.

window.localStorage.getItem('MyItem');
window.localStorage.setItem('MyItem','Fred'),

Ken

I'm aware of this. What I need in this case is a centralized location where hundreds of these little files can live and everybody can access them no matter where they're running the app. The app needs quick access to them via one file that acts as a directory. It's very similar to how GetIt works in Delphi's IDE, but the files are much smaller, probably less than 1k.

https://stellards.io ?

1 Like

have a JSON file on the webserver and call it from within your webcore app

var
  Conn: TXDataWebConnection;
  Response: IHttpResponse;
Obj: TJSObject;
begin

  Conn := TXDataWebConnection.Create(nil);
  try
    Response := TAwait.Exec<IHttpResponse>(Conn.SendRequestAsync(THttpRequest.Create('config/config.json')));
    if Response.StatusCode = 200 then
    begin
          Obj := TJSObject(TJSJSON.parse(Response.ContentAsText));
          FMySetting := JS.toString(Obj['MySetting']);
     end;
finally
  Conn.Free;
end;
2 Likes

I was thinking about that and the older one, but they're probably better for more structured data. Has pricing been announced for StellarDS yet?

Hmmm ... well, that's pretty doggone simple, for sure!

Yes, tentative pricing is shown at https://stellards.io