Monthly Archives: October 2012

MUMPS and Node.

I’d like to share some Node JS and MUMPS code to demonstrate how easy it is to write a web application using these two technologies.  I’m using Node JS and Micronetics Standard MUMPS, running on MS Windows.

Download a copy of Node from nodejs.org and install it.

The node code listens on port 8080 and proxies the request onto port 4012.

To run the node code, cd to the folder where TCPPROXY.txt is stored, and type node TCPPROXY.txt.

Restore the MUMPS code into an MSM database, and then job HTTPSRV using the MUMPS job command.

The Football League sample application serves up HTML which allows users to run a league.

There’s no web page that allows a user to setup leagues and clubs, but this can be easily done by using the following MUMPS.

Season/League.

S ^LALIGA(“L”,”4″)=”2012/2013″
S ^LALIGA(“L”,4,2)=”HARROGATE AND DISTRICT JFL (U14) – DIV 2″

Football Club.

S ^LALIGA(“C”,1)=”PANNAL SPORTS”
S ^LALIGA(“C”,2)=”KNARESBOROUGH”

Once these globals have been setup, you can then use a browser to enter the football league data.

http://192.168.2.10:8080/fix?mumps=FIXFRED3&season=4&league=2&date=28.10.2012

The above URL will allow a user to setup fixtures for 28.10.2012.

http://192.168.2.10:8080/ires2?mumps=IRES2FRED3&season=4&league=2&date=62758

The above URL will allow a user to enter the results for 28.10.2012.

http://192.168.2.10:8080/table?mumps=TABLEFRED3&season=4&league=2

The above URL will allow a user to view a league table.

Here’s some example global data.

^LALIGA(“C”,1)=”PANNAL SPORTS”
^LALIGA(“C”,2)=”KNARESBOROUGH”
^LALIGA(“C”,3)=”WIGTON MOOR”
^LALIGA(“F”,4,2)=”1″
^LALIGA(“F”,4,2,62758,1)=”1~2″
^LALIGA(“L”,4)=”2012/2013″
^LALIGA(“L”,4,2)=”HARROGATE AND DISTRICT JFL (U14) – DIV 2″
^LALIGA(“L”,4,2,62758,1)=”1~2~1~1″

Use the link below to download the code.

code

Enjoy!