Mais conteúdo relacionado 淺談後端概念2. 我是誰?
• 經歷
• 資通行動科技
• 2018-09 ~ 至今
• 好想工作室
• 2016-01 - 2018-08
2
• 參加過
• 2018 iT 邦幫忙鐵人賽 -
Node JS-Back end見聞錄
• 2017-Open Data創新應用
競賽 - 「runvis」- 優選
37. 什麼是RESTful風格?
• 功能:取得全部會員資料。
Method: GET。URL: /api/customerList
• 功能:取得單筆會員資料。
Method: GET。
URL: /api/customer/?id=1
• 功能:新增會員。
Method: POST。URL: /api/customerAdd
• 功能:修改會員。
Method: POST。URL: /api/customerEdit
• 功能:刪除會員。
Method: POST。URL: /api/
customerDelete
37
38. 什麼是RESTful風格?
• 功能:取得全部會員資料。
Method: GET。URL: /api/customerList
• 功能:取得單筆會員資料。
Method: GET。
URL: /api/customer/?id=1
• 功能:新增會員。
Method: POST。URL: /api/customerAdd
• 功能:修改會員。
Method: POST。URL: /api/customerEdit
• 功能:刪除會員。
Method: POST。URL: /api/
customerDelete
38
• 功能:取得全部會員資料。
Method: GET。URL: /api/customers
• 功能:取得單筆會員資料。
Method: GET。
URL: /api/customers/:id
• 功能:新增會員。
Method: POST。URL: /api/customers
• 功能:修改會員。
Method: PUT。URL: /api/
customers/:id
• 功能:刪除會員。
Method: DELETE。
URL: /api/customers/:id
46. Express的運行
46 reference by: Evan M. Hahn(2016). Express in action.
Middleware
Stack
1. Client
request
something
2. HTTP server
hands request
to Express
4.Your function respond to
the request
5. HTTP server
sends
response
Client
Node JS
HTTP Server
Express
APP
3. Express adds
feature to the
request and
response
55. 什麼是JWT?
• 值得一提的是Signature是由下列方式所組成:
// signature algorithm
data = base64urlEncode( header ) + “.” +
base64urlEncode( payload )
hashedData = hash( data, secret )
signature = base64urlEncode( hashedData )
55 reference by: 5 Easy Steps to Understanding JSON Web Tokens