We (Metodika) took the same, or similar, path as Joshua. A REST API built in 4D 
that can serve both 4D applications/clients but mostly web applications written 
in Angular.

We choose to break out the API into a separate 4D server and made sure it is 
stateless, meaning we can have multiple API server running all connected to the 
same 4D database. We use SQL to read/write the database. On the API server we 
use the built in web server of 4D and NTK for reading/creating json.

This allows us get horizontal scaling since the API can run on different 
physical servers. We are currently working on a small proxy server in node.js 
that can spread the load to different api servers or route request to servers 
dedicated to special tasks. It also allows us to do updates of the api with 
zero downtime by updating one api server at a time.

We really like the REST architecture as it allows us to use different 
technology on the inside while the api is always the same from the outside. But 
the pattern also make it simple from a development standpoint since all 
"actions" of the api follow the same concept with a resource and a method (GET, 
POST, PUT etc).

For documentation we are looking into using swagger but currently its on a 
simple wordpress site: https://metodika.com/tech-doc/web-api/ 
<https://metodika.com/tech-doc/web-api/>

Best,

Rikard


> On 16 Jan 2017, at 18:05, Joshua Hunter <[email protected]> wrote:
> 
> We wrote a REST API in 4D and expose it with the built in web server.  The 
> REST API serves up JSON docs formatted in Siren.  The API is documented in 
> Swagger. On the front end we wrote an AngularJS application that talks to the 
> REST API.
> 

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to