Announcement
Rob Tweed · Nov 25, 2020

mgweb-server: REST API development for Legacy Systems

Those of you who run and support older-style legacy systems on IRIS may be interested in learning about and trying out a new framework I've built on top of my colleague Chris Munt's mg_web technology (details at https://github.com/chrisemunt/mg_web).

There are quite a few older-style and legacy applications out there whose useful life can be extended by making their functionality available as REST APIs.  To make this something that can be done quickly and easily, using modern, industrial-strength web servers, I've created what I'm calling mgweb-server:

https://github.com/robtweed/mgweb-server

This can be installed to work with standalone IRIS systems, but the easiest way to try it out and understand how it works etc is to use the pre-built containerised version.  As most readers here will be interested in using it with IRIS, you can quickly and easily reconfigure the mgweb-server Container to use a separate IRIS system instead of the database it comes pre-installed with. 

Again, the easiest way to try it out with IRIS is to use the IRIS Community Edition Docker Container - so you have the web-server (Apache) and mweb-server running in one Container, and IRIS running in another, with the routines and Global storage being maintained in IRIS.

To see it all in operation, you can then install the mgweb-conduit example/demonstrator REST API suite:

https://github.com/robtweed/mgweb-conduit

Those of you familiar with the IRIS Competitions may recognise this as being yet another implementation of the RealWorld Conduit application for IRIS - this time implemented in old-school legacy M code and storing the Conduit data in Globals.

The interesting thing is that the Global storage in mgweb-conduit is identical to that used in my qewd-conduit application,  qewd-conduit abstracted those Globals as persistent JavaScript Objects.  Now, in mgweb-conduit you can see how those Globals are accessed and maintained the old-school way!

The IRIS-specific instructions can be found here:

https://github.com/robtweed/mgweb-server#using-the-mgweb-server-container-with-iris
https://github.com/robtweed/mgweb-conduit#setting-up-mgweb-conduit-on-an-iris-system
 

 

20
1 0 3 123

Replies

..and, of course, you could now be running both the mgweb-server container (Apache + mg_web) and the IRIS container on Raspberry Pi 4's (with 0.5 million global node sets/second performance), to create a very cool, low-cost REST platform. 

BTW did you know that Raspberry Pi (the company) run their public web site on a cloud-based  farm of Raspberry Pi 4s? These are the guys that run it for them: https://www.mythic-beasts.com/blog/2020/06/17/raspberry-pi-4-now-availab...

If you're interested in trying out the mgweb-server Docker Container  (aka mg_web Server Appliance) with an IRIS back-end (eg using the IRIS Community Edition Docker Container), I've put together a detailed user guide and tutorial that takes you through the entire process, step by step, showing you how to create REST APIs, along with showing you how to get it working with the pre-built mgweb-conduit back-end Demonstrator/Example on IRIS, and how to add the wc-conduit front-end to the mg_web Server Appliance.  

It's all very quick and simple to get it up and working, with lots of utility functions included in the kit that make it very simple to create your REST APIs, use JWTs, secure passwords etc.  It's a different and alternative approach to using IRIS for REST APIs that you might find interesting.

Why not take a look at:

  https://github.com/robtweed/mgweb-server/blob/master/IRIS.md