boostrapping a MEAN app (angular.js, express, node.js, mongodb)

Complete code example here – in the folder you are creating your app, place a manifest file called package.json, example: { “name”: “yourappnamehere” } – install express and other dependencies: $ sudo apt-get update $ sudo apt-get install npm $ sudo apt-get install nodejs Note: copying and pasting these commands sometimes will give you the following error message: […]

node.js: boilerplating a site with express.js

Install express globally in your system, so you can use it from anywhere: $npm install -g express Initialize your installation: $express myapp; cd myapp; Modify your package.json file inside of there, and run it. Here’s a boilerplate example of it: { “name”: “nameofyourapphere”, “version”: “0.0.1”, “description”: “”, “main”: “index.js”, “scripts”: { “test”: “echo “Error: no […]

Node.js: an app example using Yahoo geolocation service, and request library

This is a bad copy for personal use. The original series / tutorial here: 1) Make sure node and npm are installed: $node –version $npm –version 2) Setup a local space for your project $mkdir myapp; cd myapp; $npm install express Since we are not using -g to install this globally, this express installation […]

node.js: how it is different from other web platforms

Node has a single thread, looping on itself to handle requests. Unlike PHP and other platforms, where each request spawn its own thread. This means: if a request modify a variable with global scope, the modified variable will be served in the next request. Node process in a nutshell: loop taking request (running in infinite […]