SlideShare a Scribd company logo
from	
  basic	
  to	
  middle
clonnhttp://about.me/clonn
Expressjs
Thursday, September 5, 13
Caesar Chi
clonncd
Thursday, September 5, 13
• node
• npm
• git
• grunt.js (optional)
Material
Thursday, September 5, 13
• http://expressjs.com
• https://github.com/visionmedia/express/wiki
Thursday, September 5, 13
• npm install -g express
• maybe you will use “sudo”
• make express work well
Basic
Thursday, September 5, 13
• express as cli
• -e (ejs), -j (jshtml), -H (hogan)
• -c (css)
• -h (call help)
• -v (version)
• -s (session)
Basic
Thursday, September 5, 13
• express as cli
• -e (ejs), -j (jshtml), -H (hogan)
• -c (css)
• -h (call help)
• -v (version)
• -s (session)
Basic
Thursday, September 5, 13
• express as cli
• -e (ejs), -j (jshtml), -H (hogan)
• -c (css)
• -h (call help)
• -v (version)
• -s (session)
Basic
Thursday, September 5, 13
• express as cli
• -e (ejs), -j (jshtml), -H (hogan)
• -c (css)
• -h (call help)
• -v (version)
• -s (session)
Basic
Thursday, September 5, 13
• express as cli
• -e (ejs), -j (jshtml), -H (hogan)
• jade (as default)
Basic
Thursday, September 5, 13
• express as cli
• -e (ejs), -j (jshtml), -H (hogan)
• jade (as default)
Basic
They are Template engine
Thursday, September 5, 13
• Why need template engine?
Basic
Thursday, September 5, 13
• Why need template engine?
Basic
•user-data
•cargo-list
•cache-store
Thursday, September 5, 13
• Why need template engine?
Basic
•user-data
•cargo-list
•cache-store
Thursday, September 5, 13
• Why need template engine?
Basic
•user-data
•cargo-list
•cache-store We need Template engine
Thursday, September 5, 13
We need
Template engine
MVC (i hate u)
Because
Thursday, September 5, 13
• express as cli
• -css (default css)
• stylus (as default)
Basic
Thursday, September 5, 13
• express as cli
• -css (default css)
• stylus will compile to pure CSS in static
folder
Basic
Thursday, September 5, 13
• run express cli
• express [-option] [application_name]
Basic
Thursday, September 5, 13
• run express cli
• express [-option] [application_name]
Basic
Thursday, September 5, 13
• run express cli
• express [-option] [application_name]
Basic
Thursday, September 5, 13
• run express cli
Basic
Thursday, September 5, 13
• run express cli
Basic
Thursday, September 5, 13
• run express cli
Basic
Thursday, September 5, 13
• run express cli
Basic
Thursday, September 5, 13
Now you know
Express-cli
as well
Thursday, September 5, 13
• folder structure
Content
Thursday, September 5, 13
• folder structure
Content
npm package config
Thursday, September 5, 13
• folder structure
Content
init file (app.js)
Thursday, September 5, 13
• folder structure
Content
static folder
Thursday, September 5, 13
• folder structure
Content
route setting
Thursday, September 5, 13
• folder structure
Content
view folder
Thursday, September 5, 13
it is basic
Express
folder structure
Thursday, September 5, 13
• Setting in Express
• app.listen
Middle
Thursday, September 5, 13
• Setting in Express
• app.configure
Middle
read environment variable
Thursday, September 5, 13
• Setting in Express
• app.set, app.get
• app.enable, app.disable
Middle
http://expressjs.com/api.html#app-settings
Thursday, September 5, 13
• Setting in Express
• app.use
Middle
middleware
route
view
Thursday, September 5, 13
• Setting in Express
• app.use
Middle
middleware
route
view
app.use, will execute every route
Thursday, September 5, 13
• Setting in Express
• app.get,
• app.post,
• app.delete,
• app.update
Middle
middleware
route
view
Thursday, September 5, 13
• Setting in Express
• app.all
• app.get,
• app.post,
• app.delete,
• app.update
Middle
middleware
route
view
Thursday, September 5, 13
• Setting in Express
• app.locals
Middle
•user-data
•cargo-list
•cache-store
if those parameters are default
Thursday, September 5, 13
it is middleware
Express
app original method
Thursday, September 5, 13
• req get parameter
• req.params
Request
id = 3
Thursday, September 5, 13
• req get parameter
• req.query
Request
getId = 30
Thursday, September 5, 13
• req get parameter
• req.body
Request
Thursday, September 5, 13
• req get parameter
• req.body
Request
Thursday, September 5, 13
• req get parameter
• req.files
Request
Thursday, September 5, 13
• req get cookie
• req.cookies (read cookie)
Request
Thursday, September 5, 13
• req about HEADER (read only)
• req.get, req.header
• req.is
• req.ip, req.ips
• req.host (req.subdomains)
• req.protocol, (req.secure -> 'https' == req.protocol;)
Request
Thursday, September 5, 13
• req about HEADER (read only)
• req.xhr
Request
Thursday, September 5, 13
• req about HEADER (read only)
• req.xhr
Request
Thursday, September 5, 13
• req about HEADER (read only)
• req.xhr
Request
Thursday, September 5, 13
Request is
READ only
in ExpressJS
Thursday, September 5, 13
• res about HEADER
• res.status (res.statusCode)
Response
(code only)
Thursday, September 5, 13
• res about HEADER
• res.clearCookie
Response
Thursday, September 5, 13
• res about HEADER
• res.set, res.header
Response
Thursday, September 5, 13
• res about parameters
• res.locals (app.locals is different)
Response
life cycle is only in url period.
Thursday, September 5, 13
• res client render
• res.redirect
Response
Thursday, September 5, 13
• res client render
• res.json, res.send
Response
HEADER: application/json
Thursday, September 5, 13
• res client render
• res.download
Response
Thursday, September 5, 13
• res client render
• res.render
Response
Thursday, September 5, 13
Response write data
in Express
Thursday, September 5, 13
more?
Thursday, September 5, 13
change middleware
https://github.com/visionmedia/express/wiki
Thursday, September 5, 13
cross domain access
http://stackoverflow.com/questions/11181546/node-js-express-cross-domain-scripting
Thursday, September 5, 13
co-work with angularjs
https://github.com/btford/angular-socket-io-im
Thursday, September 5, 13
future!!!
Thursday, September 5, 13
express 4.x roadmap.
https://github.com/visionmedia/express/wiki/4.x-roadmap
Thursday, September 5, 13
Q & A?
Thursday, September 5, 13
Advertising
Thursday, September 5, 13
http://nodejs.tw/
Thursday, September 5, 13
http://book.nodejs.tw/
Thursday, September 5, 13
http://nodeknockout.nodejs.tw/
2013/Nov/8 - 10
Thursday, September 5, 13

More Related Content

PDF
ZIP
Redis and Ohm
PPTX
Commitmas 2015
PPTX
Parse, scale to millions
PPT
Linux basics by Raj Miraje
PPTX
Value protocols and codables
PDF
Monitoring Behavioral Driven Infrastructures mit Cucumber-Nagios by Mike Adolphs
PPTX
Php7 hhvm and co
Redis and Ohm
Commitmas 2015
Parse, scale to millions
Linux basics by Raj Miraje
Value protocols and codables
Monitoring Behavioral Driven Infrastructures mit Cucumber-Nagios by Mike Adolphs
Php7 hhvm and co

Viewers also liked (20)

PPTX
Express js
PDF
Express node js
PPTX
Building Web Apps with Express
PDF
Create Restful Web Application With Node.js Express Framework
PPTX
Node.js Express
PPTX
Generics of JAVA
PPT
2CPP15 - Templates
PDF
Use the @types, Luke
PDF
On Parameterised Types and Java Generics
PDF
Realtime web applications with ExpressJS and SocketIO
PDF
Socket.IO - Alternative Ways for Real-time Application
PDF
Enterprise Tic-Tac-Toe
PDF
Pizza compiler
PDF
Anatomy of a Modern Node.js Application Architecture
PDF
Nodejs Explained with Examples
PPTX
Introduction to Node.js
PDF
Functional Programming Patterns (NDC London 2014)
PPTX
Cabalgata de Reyes La Victoria de Acentejo
PPTX
Medios de transmisión 1
PPS
BEAUTY OF COLOURS
Express js
Express node js
Building Web Apps with Express
Create Restful Web Application With Node.js Express Framework
Node.js Express
Generics of JAVA
2CPP15 - Templates
Use the @types, Luke
On Parameterised Types and Java Generics
Realtime web applications with ExpressJS and SocketIO
Socket.IO - Alternative Ways for Real-time Application
Enterprise Tic-Tac-Toe
Pizza compiler
Anatomy of a Modern Node.js Application Architecture
Nodejs Explained with Examples
Introduction to Node.js
Functional Programming Patterns (NDC London 2014)
Cabalgata de Reyes La Victoria de Acentejo
Medios de transmisión 1
BEAUTY OF COLOURS
Ad

Similar to Expressjs basic to advance, power by Node.js (20)

PPTX
CH-2.2.1 (1).pptx hisnsmmzmznznNNNMamMamam
PPTX
23003468463PPT.pptx
PPTX
MERN SRTACK WEB DEVELOPMENT NODE JS EXPRESS
PDF
What is Node.js? (ICON UK)
ODP
Nodejs Intro - Part2 Introduction to Web Applications
PPTX
Unit 1 Express J for mean stack and mern
PPT
Node.js Express Framework
PPTX
ExpressJs Session01
PDF
Node js introduction
PPTX
Express JS
PDF
Introduction to node js - From "hello world" to deploying on azure
PPTX
Introducing Node.js in an Oracle technology environment (including hands-on)
PDF
Building Killer RESTful APIs with NodeJs
PPTX
Introduction to Node.js
PDF
ExpressJS-Introduction.pdf
PPT
nodejs tutorial foor free download from academia
PDF
Express: A Jump-Start
PDF
Build Web Apps using Node.js
PDF
Introduction to Node.js: What, why and how?
CH-2.2.1 (1).pptx hisnsmmzmznznNNNMamMamam
23003468463PPT.pptx
MERN SRTACK WEB DEVELOPMENT NODE JS EXPRESS
What is Node.js? (ICON UK)
Nodejs Intro - Part2 Introduction to Web Applications
Unit 1 Express J for mean stack and mern
Node.js Express Framework
ExpressJs Session01
Node js introduction
Express JS
Introduction to node js - From "hello world" to deploying on azure
Introducing Node.js in an Oracle technology environment (including hands-on)
Building Killer RESTful APIs with NodeJs
Introduction to Node.js
ExpressJS-Introduction.pdf
nodejs tutorial foor free download from academia
Express: A Jump-Start
Build Web Apps using Node.js
Introduction to Node.js: What, why and how?
Ad

More from Caesar Chi (20)

PDF
為何技術老人這樣想那樣做?
PDF
面試AI技術大進化,加速招聘軟體工程師的全套攻略!
PDF
初探工程師升級手冊 2022
PDF
預約及客服 LINE 服務串接大挑戰
PDF
Remote monitoring widget setup and customization
PDF
JS 從 Non-type 到 Type 的愛恨情仇
PDF
LINE@ 2.0 offline to online
PDF
Chatbot 智能溝通策 流程規劃與實做 e-Commerce Chatbot - AI strategy and Chat bot user flow
PDF
PWA and Chatbot - with e-Commerce experience sharing
PDF
Morden F2E Education - Think of Progressive Web Apps
PDF
codecept.js introduce - front end test E2E tool introduce
PDF
遠端團隊專案建立與管理 remote team management 2016
PDF
Introduce Angular2 & render & firebase flow
PDF
如何提昇技術力 - 參與技術社群之經驗分享
PDF
html5 & phonegap
PDF
From devOps to front end Ops, test first
PDF
Docker with Cloud Service GCPUG
PDF
從失敗中學習打造技術團隊
PDF
Docker with Cloud Service
PDF
技術單兵作戰及團隊開發流程差異
為何技術老人這樣想那樣做?
面試AI技術大進化,加速招聘軟體工程師的全套攻略!
初探工程師升級手冊 2022
預約及客服 LINE 服務串接大挑戰
Remote monitoring widget setup and customization
JS 從 Non-type 到 Type 的愛恨情仇
LINE@ 2.0 offline to online
Chatbot 智能溝通策 流程規劃與實做 e-Commerce Chatbot - AI strategy and Chat bot user flow
PWA and Chatbot - with e-Commerce experience sharing
Morden F2E Education - Think of Progressive Web Apps
codecept.js introduce - front end test E2E tool introduce
遠端團隊專案建立與管理 remote team management 2016
Introduce Angular2 & render & firebase flow
如何提昇技術力 - 參與技術社群之經驗分享
html5 & phonegap
From devOps to front end Ops, test first
Docker with Cloud Service GCPUG
從失敗中學習打造技術團隊
Docker with Cloud Service
技術單兵作戰及團隊開發流程差異

Recently uploaded (20)

PPTX
Indian ancient knowledge system, ancient geopolitics
PDF
The Most Dynamic Lawyer to Watch 2025.pdf
PDF
KAL 007 Manual: The Russian Shootdoown of Civilian Plane on 09/01/1983
PDF
Chandrababu Naidu's Vision: Transforming Andhra Pradesh into India's Drone Ca...
PDF
05082025_First India Newspaper Jaipur.pdf
PDF
Mathura Sridharan's Appointment as Ohio Solicitor General Sparks Racist Backl...
DOCX
Memecoin news and insights on memecoinist
PDF
The Blogs_ Hamas’s Deflection Playbook _ Andy Blumenthal _ The Times of Israe...
PDF
Conflict, Narrative and Media -An Analysis of News on Israel-Palestine Confli...
PPTX
Sir Creek Conflict: History and its importance
PDF
JUDICIAL_ACTIVISM_CRITICAL_ANALYSIS in india.pdf
PPTX
PPT on SardarPatel and Popular Media.pptx
PDF
Aron Govil on Why America Lacks Skilled Engineers.pdf
PDF
Supereme Court history functions and reach.pdf
PDF
424926802-1987-Constitution-as-Basis-of-Environmental-Laws.pdf
PDF
Executive an important link between the legislative and people
DOCX
Breaking Now – Latest Live News Updates from GTV News HD
PDF
2025-07-24_CED-HWB_WIPP_ACO000000001.pdf
PPTX
ASEANOPOL: The Multinational Police Force
DOC
证书结业SU毕业证,莫道克大学毕业证假学位证
Indian ancient knowledge system, ancient geopolitics
The Most Dynamic Lawyer to Watch 2025.pdf
KAL 007 Manual: The Russian Shootdoown of Civilian Plane on 09/01/1983
Chandrababu Naidu's Vision: Transforming Andhra Pradesh into India's Drone Ca...
05082025_First India Newspaper Jaipur.pdf
Mathura Sridharan's Appointment as Ohio Solicitor General Sparks Racist Backl...
Memecoin news and insights on memecoinist
The Blogs_ Hamas’s Deflection Playbook _ Andy Blumenthal _ The Times of Israe...
Conflict, Narrative and Media -An Analysis of News on Israel-Palestine Confli...
Sir Creek Conflict: History and its importance
JUDICIAL_ACTIVISM_CRITICAL_ANALYSIS in india.pdf
PPT on SardarPatel and Popular Media.pptx
Aron Govil on Why America Lacks Skilled Engineers.pdf
Supereme Court history functions and reach.pdf
424926802-1987-Constitution-as-Basis-of-Environmental-Laws.pdf
Executive an important link between the legislative and people
Breaking Now – Latest Live News Updates from GTV News HD
2025-07-24_CED-HWB_WIPP_ACO000000001.pdf
ASEANOPOL: The Multinational Police Force
证书结业SU毕业证,莫道克大学毕业证假学位证

Expressjs basic to advance, power by Node.js