From Node.js noob to not so noob

Post on 15-Apr-2017

724 views 3 download

Transcript of From Node.js 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

@reybango

blog.reybango.com

Obligatory Product Placement!!!!

I’m a Node n00b.

<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="reybango@gmail.com"> <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>

<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>

@kevinold

@joemccann

IMPOSTOR SYNDROME!

Bring a voice to the n00bs!

Learning Node.js is hard.

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); });

<cfoutput>#myMessedUpVar#</cfoutput>

nvm install node --reinstall-packages-from=node

Nodemon

How do we help the n00bs?

Get yourself a mentor.

Immediately install developer tools.

Immediately install Express.

Centralized, curated list of learning

resources.

Centralized, curated list of the must-have

npm packages to install.

Start with security best practices.

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

Real-world examples of what can be built with

Node.js.

Community-driven Node.js mentorship

program.

@reybango

reybango@gmail.com