jguerra[at}northeastern.edu | @duto_guerra
Slides:http://johnguerra.co/lectures/webDevelopment_fall2020/06_Node/
Class page:http://johnguerra.co/classes/webDevelopment_spring_2020/
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/