vendredi 20 février 2015

how to adapt an app to work with node and express?


I'm after some direction about how to adapt a web app to work with express/mongodb/node.js Disclaimer: newbie to node, back-end server devlopment etc.


I have a web app which consists of a single html page, some css and a fair amount of javascript. Obviously, at this stage, everything runs client-side from the browser which is fine... but now I'm at the stage where I need to establish some server side features such as user account control, file upload and storage etc. As I am familiar with javascript, Node is an obvious choice for me.


From my research so far, it seems fairly straight forward to setup a simple express based server and I've found several hello-world tutorials to do just this, but most of these tutorials seem to be about starting a new app from scratch, and I'm left wondering what to do with all my existing javascript code... so my question is this.. Should I



  1. leave the client side code as is and setup a simple server side node implementation that just talks to the database

  2. Setup a server side node implementation, move all my javascript to the server and use some kind of templating to serve up content to the browser.

  3. I'm completely missing the point here, and there's a way better way to do this


Pros and cons would be great Thanks in advance, and go easy on a newbie!!





Aucun commentaire:

Enregistrer un commentaire