I think express is a bit more than a facade - what you get with node is the bare bones.

On 3 May 2016, at 11:23, Aaron Bartell <aaronbartell@xxxxxxxxx> wrote:

I am not sure it's strictly true to say it has its own web server - you'd
have to put some code together yourself - but you'd be better off making
use of something like express.js.

I am not sure I follow the first part of your question. The web server
embedded/included with Node.js is here:
http://bit.ly/nodejs-12-http_createserver ExpressJs is a facade that uses
the embedded/included web server. Further, here's the actual net.js code:
https://github.com/nodejs/node/blob/master/lib/net.js

And with the 'cluster' npm you can easily load balance between multiple
processes (IBM i jobs). Here's some sanitized sample code I wrote for a
Node.js-on-IBM-i customer. Basically the 'rpg' module contains calls to
RPG using the iToolKit.

var http = require('http');
var rpg = require('./rpg')
var app = require('express')()
var cluster = require('cluster')

if (cluster.isMaster) {
for (var i = 0; i < 2; i += 1)
cluster.fork()
} else {
process_request()
}

function process_request(){
app.get('/getprice', function (req, res) {
rpg.pgm1(req.query.myparm, req.query.myparm2, function(output){
res.send(output)
})
})
}

http.createServer(app).listen(8080)
console.log('Listening on port %d', 8080)

Aaron Bartell
litmis.com - Services for open source on IBM i


On Tue, May 3, 2016 at 10:02 AM, Kevin Turner <kevin.turner@xxxxxxxxxxxxxxx>
wrote:

The node.js route is the one for me (even if I am going to call RPG
eventually on the back end). I am not sure it's strictly true to say it has
its own web server - you'd have to put some code together yourself - but
you'd be better off making use of something like express.js.

On 3 May 2016, at 15:42, Aaron Bartell <aaronbartell@xxxxxxxxx> wrote:

What language do they use?

<vendor>
If RPG, check out RPG-XML Suite: rpg-xml.com
</vendor>

If they're open to non-RPG options then things like Node.js make it dead
simple to do web services (no Apache/Tomcat config necessary, Node.js
includes its own webserver).


Aaron Bartell
litmis.com - Services for open source on IBM i


On Tue, May 3, 2016 at 8:12 AM, Jim Oberholtzer <
midrangel@xxxxxxxxxxxxxxxxx
wrote:

Folks:



I have a customer that is about to take the plunge into web services.
They
first need to choose if they use WAS 8.5 Express, IWS or TOMCAT. Some
of
the IBM i instances have the Zend server so they would use that when
available. Next they need a good primer about design and
implementation.
I've found the basic web sites from IBM but I'm wondering if the group
has
some suggestions on best practices and resources to use.



The customer is at V7R1 now but will be at V7R2 very soon and
potentially
V7R3 by end of year. Any comments on the IBM i environment as it
relates
to
web services would be welcome as well.



While I can build and deploy a simple web service, I am far from an
expert
therefore my request to you.



--

Jim Oberholtzer

Agile Technology Architects



--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/

________________________________

NOTICE: The information in this electronic mail transmission is intended
by CoralTree Systems Ltd for the use of the named individuals or entity to
which it is directed and may contain information that is privileged or
otherwise confidential. If you have received this electronic mail
transmission in error, please delete it from your system without copying or
forwarding it, and notify the sender of the error by reply email or by
telephone, so that the sender's address records can be corrected.




--------------------------------------------------------------------------------


CoralTree Systems Limited
25 Barnes Wallis Road
Segensworth East, Fareham
PO15 5TT

Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton, UK
SO15 2EA
VAT Registration Number 834 1020 74.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.


___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/


________________________________

NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.



--------------------------------------------------------------------------------


CoralTree Systems Limited
25 Barnes Wallis Road
Segensworth East, Fareham
PO15 5TT

Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton, UK
SO15 2EA
VAT Registration Number 834 1020 74.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.