JavaScript & NodeJS

October 8, 2016
About Me
Organizer of CODE Norman
twitter: @bchirgwin
linkedin: linkedin.com/in/bchirgwin
Senior Software Engineer at Iteris


Workshop Expectations
- Pragmatic Approach
- Get out of it what you put into it
- Workshop
- Homework
- Available for additional help
- Most Thursday evenings
- Other times on request
Online Tutorials
- Free code camp
- Javascript
- NodeJS

Javascripting Tutorial
Workshops
Git & GitHub - September 17- NodeJS & Javascript - October 8
- Unit Tests - November 12?
- Database & Data Storage - December
- AngularJS Front-end Development - January
- End to End Testing - February
- Review open source projects - March
- Code Norman Open Source Project Kickoff - April
Editor/IDE
- Visual Studio Code
- Webstorm
NodeJS
- JavaScript Server Side
- Asynchronous
- npm
- runs on IoT
- Support
NodeJS
- 1 million concurrent connections (August 2012)
- nginx vs apache
- nginx is asynchronous, apache is synchronous
- https://blog.webfaction.com/2008/12/a-little-holiday-present-10000-reqssec-with-nginx-2/
Sync vs Async
Sync vs Async
Sync or Async
- Telephone
- Answering Machine
- Television
- VCR
- Netflix
- (async)
- (sync)
- (async)
- (sync)
- (async)
- (async)
RESTful
- REpresentational State Transfer
- www.domain.com/resource/{id}?q
- HTTP Methods
- GET
- PUT
- POST
- DELETE
GET example
- reply with a list of users
- method: GET
- Url: www.domain.com/users
- GET method does not accept a body
GET {id} example
- reply: user with id = 123
- method: GET
- Url: www.domain.com/users/123
POST example
- adds user & reply: user including id
- method: POST
- Url: www.domain.com/users/
- body: {
firstname: 'Brian',
lastname: 'Chirgwin'
}
PUT example
- Updates user with id 123
- method: PUT
- Url: www.domain.com/users/123
- body: {
firstname: 'Brian',
lastname: 'Chirgwin',
middleInitial: 'T'
}
Node Project
- npm - node package manager
- third-party libraries
- hapi - web server framework
- lodash - utility library
- joi - validation library
- boom - easy html errors (404, etc...)
- Create a RESTful service for a resource
- Use browser and postman to send requests
Raffle
- JetBrains IDE

WebStorm
PhpStorm
PyCharm
RubyMine
AppCode
CLion
DataGrip
Rider
IntelliJ IDEA
JavaScript & NodeJS
By Brian Chirgwin
JavaScript & NodeJS
- 957