nationjs: node noob to not so noob

53
FROM NOOB TO NOT SO NOOB OR HOW I’M TRYING TO GET GOOD AT NODE.JS

Upload: reybango

Post on 22-Jan-2017

478 views

Category:

Software


6 download

TRANSCRIPT

Page 1: NationJS: Node Noob to not so Noob

FROM NOOB TO NOT SO

NOOBO R H O W I ’ M T RY I N G T O G E T G O O D AT N O D E . J S

Page 2: NationJS: Node Noob to not so Noob

@reybango

blog.reybango.com

Page 3: NationJS: Node Noob to not so Noob
Page 4: NationJS: Node Noob to not so Noob
Page 5: NationJS: Node Noob to not so Noob

Obligatory Product Placement!!!!

Page 6: NationJS: Node Noob to not so Noob

I’m a Node n00b.

Page 7: NationJS: Node Noob to not so Noob
Page 8: NationJS: Node Noob to not so Noob

<cfset session.authy_id = 0> <!--- Send the Authy request to enable two-factor auth for the user --->

<cfhttp url="https://api.authy.com/protected/json/users/new" method="post"> <cfhttpparam type="formField" name="api_key" value=”application.api_key"> <cfhttpparam type="formField" name="user[email]" value="[email protected]"> <cfhttpparam type="formField" name="user[cellphone]" value='#form.cellphone#'> <cfhttpparam type="formField" name="user[country_code]" value='#form.country#'>

</cfhttp>

<!--- Query param to show the JSON response ---> <cfif isDefined( "url.json" )>

<cfdump var="#cfhttp.filecontent#"> <cfabort>

</cfif>

<!--- Convert the JSON response to a CF struct for easier usage ---> <cfset myJSONStruct = deserializeJSON(cfhttp.filecontent)>

<!--- If you get an Authy ID sent back, all is good and we can test their mobile device ---> <cfif myJSONStruct.user.id>

<cfset session.authy_id = myJSONStruct.user.id> <cflocation url="gettoken.cfm" addtoken="true"> <cfabort>

</cfif>

Page 9: NationJS: Node Noob to not so Noob

<cfquery name = "GetCourses" dataSource = "cfdocexamples"> SELECT Dept_ID, CorName, CorLevel FROM courseList ORDER by Dept_ID, CorLevel, CorName

</cfquery>

<p><cfoutput query = "GetCourses" group="CorLevel” GroupCaseSensitive="True">

#Dept_ID# #CorLevel#<br></cfoutput></p>

Page 10: NationJS: Node Noob to not so Noob
Page 11: NationJS: Node Noob to not so Noob
Page 12: NationJS: Node Noob to not so Noob
Page 13: NationJS: Node Noob to not so Noob

@joemccann

Page 14: NationJS: Node Noob to not so Noob

@joemccann is the David Beckham of Node.js

Page 15: NationJS: Node Noob to not so Noob

Bring a voice to the n00bs!

Page 16: NationJS: Node Noob to not so Noob

Learning Node.js is hard.

Page 17: NationJS: Node Noob to not so Noob
Page 18: NationJS: Node Noob to not so Noob
Page 19: NationJS: Node Noob to not so Noob
Page 20: NationJS: Node Noob to not so Noob

@cmrnh please be my Node.js mentor. You r0x0r!

Page 21: NationJS: Node Noob to not so Noob
Page 22: NationJS: Node Noob to not so Noob

app.get('/', function(request, response) { response.send( myMessedUpVar ); });

unirest.get('http://www.thinkful.com/').end(function(response) { console.log('Status:', response.statusCode);

console.log('Headers: ', response.headers); console.log('Body:', response.body); });

Page 23: NationJS: Node Noob to not so Noob
Page 25: NationJS: Node Noob to not so Noob
Page 26: NationJS: Node Noob to not so Noob

<cfoutput>#myMessedUpVar#</cfoutput>

Page 27: NationJS: Node Noob to not so Noob
Page 28: NationJS: Node Noob to not so Noob
Page 29: NationJS: Node Noob to not so Noob
Page 30: NationJS: Node Noob to not so Noob
Page 31: NationJS: Node Noob to not so Noob
Page 32: NationJS: Node Noob to not so Noob
Page 33: NationJS: Node Noob to not so Noob

nvm install 4.3.2 --reinstall-packages-from=4.3.1

Page 34: NationJS: Node Noob to not so Noob

Nodemon

Page 35: NationJS: Node Noob to not so Noob

How do we help the n00bs?

Page 36: NationJS: Node Noob to not so Noob

Get yourself a mentor.

Page 37: NationJS: Node Noob to not so Noob
Page 38: NationJS: Node Noob to not so Noob

Immediately install developer tools.

Page 39: NationJS: Node Noob to not so Noob

Obligatory Product Placement!!!!

Page 40: NationJS: Node Noob to not so Noob

• nvm – Node Version Manager • VS Code• Node-inspector• Nodemon• Grunt or Gulp CLI

IMMEDIATELY INSTALL DEVELOPER TOOLS

Page 41: NationJS: Node Noob to not so Noob

MENTOR-BASED LEARNING

Page 42: NationJS: Node Noob to not so Noob

FREE LEARNING

Page 43: NationJS: Node Noob to not so Noob

ON-DEMAND LEARNING

Page 44: NationJS: Node Noob to not so Noob

• Express • Express-handlebars• Grunt or Gulp• Mocha• Chai• ESLint or JSHint• body-parser

MUST-HAVE STARTER NPM PACKAGES

Page 45: NationJS: Node Noob to not so Noob

Start with security best practices.

Page 46: NationJS: Node Noob to not so Noob
Page 47: NationJS: Node Noob to not so Noob
Page 48: NationJS: Node Noob to not so Noob

npm i nsp -g cd your-fantastic-app nsp check

Page 49: NationJS: Node Noob to not so Noob

By: Crs9740 https://commons.wikimedia.org/wiki/File:Spartan_Race_-_Muddy_Hit.jpg

Page 50: NationJS: Node Noob to not so Noob

Photo Credit: Nuvision Action Image

Page 51: NationJS: Node Noob to not so Noob

Photo Credit: Jessica Lipari, USAREUR

Page 52: NationJS: Node Noob to not so Noob

Photo Credit: Spartan.com

Page 53: NationJS: Node Noob to not so Noob

@reybango

[email protected]