What differentiates JS on the server from the client is its ability to do stuff out of the sandboxed environment of the browser, like reading and writing files on your hard drive. Spooky? Fear not.
If you want to persist data among different pages you can use cookies or sessions. Cookies are persisted on the client, while sessions on the server, so it really depends on what you are doing.
In this post we will be talking about getting data from other websites, something cURL has been doing for eons, but in server-side JS-speak it is called HTTP Client and here you will learn how to use it.
We deal with forms a lot to capture data from the user and store it in our databases, sometimes we use GET, most of the time we use POST to pass that data to our server in order to handle it.
It's been an interesting experience building this blog engine using Javascript on the server with V8 and V8CGI. It showed us that everything we do today with python, ruby or php can easily be done with our beloved javascript, so why not give it a try?
Final phase, the admin console, where we can list, edit and delete entries at will. This post is going to be a little longer than previous ones so don't get bored, pay attention.
For this step we are going to need an html editor so we can write articles prettily formatted. There are plenty of editors already in the wild, but some are such a pain to install and use that I decided to go with Yahoo Rich Text Editor, in the name of simplicity.
Now that we have our main window ready and our database tuned up, we need to show the articles when users click on their links. Here is how we are going to do that.
To get the real data from MySQL we will be using our good friend from a previous post, the dataserver.jss library which will handle all our data needs.
Javascriptoid is a blog dedicated to everything javascript, specially on the server
From tutorials to tips and tricks, step by step, on path to world-wide-web domination