From b6c2b5feb2884f064e93daa931fb2294398a2cfd Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Sun, 21 Aug 2016 21:46:40 -0400 Subject: [PATCH] instantiation for express --- node.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/node.md b/node.md index 4294a33..df798f5 100644 --- a/node.md +++ b/node.md @@ -30,6 +30,28 @@ require('yourJSFile.js'); You can assign this to a variable to use later +## Instantation + +First require express: + +```javascript +var express = require('express'); //include express package +``` + +`express` has lots of abilities, but we just want to start up a server app: + +```javascript +var app = express(); // create an express app +``` + +Then make it listen on a port + +```javascript +app.listen(3000, function(){ //start the server + console.log('listening on port ' + PORT); +}); +``` + ## Routing ## MVC ## Views