Link to home
Start Free TrialLog in
Avatar of AlphaLolz
AlphaLolzFlag for United States of America

asked on

Recommendations on node.js end-user page approach

I've been putting together an api using node.js that supports some document management functions with mongodb as the DB.  Working well.

I've been using postman to test this, but now I have to start putting together some end-user web pages so that this prototype can be consumed by real people.

I'm trying to consider a good approach to this.  I'm thinking of having the page content itself in files and then having the node code just read it and send it down to the user.  Is that reasonable?  What's the best practice.  This is my first real node web site so I'm not certain and everything I see on youtube is all very rudimentary.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlphaLolz

ASKER

Nope.  I'm looking for a best practice on how to organize web page contents.  I've been finding some pages that are saving the web pages as individual files and then sending those down.  That seems reasonable.

I've seen a lot of very, very simple demo sites that just include the web page content in the node.js file and that seems a bit awkward (with a big, big node.js file), but seems the best way you could create dynamic content, unless you have the web page pull that data down using an API.
you can also setup a apache httpd or nginx server and when the URL match your API send the request to your node server
so Apache httpd or nginx act like proxy
Actually, that's something I hadn't thought about (too heads-down I guess on the API).  I can use a variety of web/jsp servers like those or tomcat, glassfish, etc.

I'm still leaning towards having the node app manage the pages and not just the API though as it reduces the number of moving parts I think.
tomcat, glassfish, etc. ?

tomcat and glassfish as proxy ?
not their purpose, apache httpd and nginx, yes
Not as proxy, however it's been pretty common practice at my client to use Tomcat in particular so as not to box themselves into site that may require some dynamic functionality.
now tomcat...
use a proxy : apache httpd or nginx
thanks