ja.guerrag[at}uniandes.edu.co | @duto_guerra
Slides:http://johnguerra.co/lectures/webDevelopment_spring2017/06_Node/
Class page:http://johnguerra.co/classes/webDevelopment_spring_2017/
Interactive Shell
$ node
Some things work only on the browser, some only on the server
$ npm install express
Creates a local node_modules/
folder
$ npm install -g express
Installs it for the whole system
# Run only once
$ npm init
# Then for each package
$ npm install --save express
Installs it locally and creates a packages.json
file that saves the dependency
packages.json
{
"name": "webdevex1",
"version": "1.0.0",
"description": "TEst",
"main": "index.js",
"dependencies": {
"express": "^4.14.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/john-guerra/webDevEx1.git"
},
"author": "John Alexis Guerra Gómez",
"license": "MIT",
"bugs": {
"url": "https://github.com/john-guerra/webDevEx1/issues"
},
"homepage": "https://github.com/john-guerra/webDevEx1#readme"
}
Allows us to create a simple HTTP Server
http://expressjs.com/Update your webpage displaying it from node+express for the class' students loading directly from the Google sheet