Jul 6, 2021Basic understanding of Testing & CI/CD前言 先統整 TEST 和 CI/CD 相關基礎知識。 之後再統整: (1) Node.js 的 Express Testing Tools (2) 串接 CI/CD 的實作方法 Roadmap 後端 Back-end Roadmap-Testing&CI/CDTesting2 min readBasic understanding of Testing & CI/CD前言先統整 TEST 和 CI/CD 相關基礎知識。之後再統整:(1) Node.js 的 Express Testing Tools(2) 串接 CI/CD 的實作方法Roadmap後端 Back-end Roadmap-Testing&CI/CD----
Jun 16, 2021Express: Router & Middleware前言 目的:觀察和理解 Middleware 中的: (1) app.use、(2) next()、(3) Router 順序,對 request 流向的影響。 方法:建立一組 Router 設定檔(範例),包含 4 組設定 (Name代稱[Router])和最終回傳 JSON: (1) Kevin [app.use] (2) John [POST/me] (3) Jimmy [app.use*] (4) Mary [GET/me] (5) Final JSON:res.json({answer: req.name}) Express-Using middleware Express is a routing and middleware web framework that has minimal functionality of its…Expressjs3 min read
Jun 16, 2021JavaScript: Currying & Coercion (型別強制轉換)前言 以範例理解 Currying 觀念和屬於弱型別 JavaScript 的型別強制轉換特性。 Currying Currying is an advanced technique of working with functions. It’s used not only in JavaScript, but in other languages as well. Currying is a transformation of functions that translates a function from callable as f(a, b, c) into callable as f(a)(b)(c). Currying doesn’t…Java Script2 min read
Jun 13, 2021express-router: organizing routes of an app前言 Alpha Camp 課程中,依據不同教師,包含約 2–3 種不同 Route 分流寫法。 我選擇對於自己較易理解的寫法,歸納統整成 organizational chart (組織圖),幫助提點記憶和快速查詢。 express-router 套件 (npm 官網) express-router is a library for organizing routes of an express application. express-router lets you write your express routes in a simpler way. You just have to create a ‘routes’ folder inside your project and…Nodejs2 min read
Jun 13, 2021Deployment: Heroku更新 5. 重新上傳 Heroku:.env&FACEBOOK for Developers 前言 佈署 Heroku,以整合第三方 API-Imgur 和切換成 MySQL Database 為例,步驟和指令: 前置作業 (1) 建立個人 Heroku 帳號 (2) Heroku CLI:Download and install PostgreSQL ( Heroku 預設 ) 整合 Imgur API PostgreSQL 換成 MySQL (ClearDB MySQL) 重新上傳 Heroku:.env&FACEBOOK for Developers 2. PostgreSQL ( Heroku 預設 ) (1) 安裝套件:node-postgres (2)…Deployment2 min read
Jun 12, 2021JavaScript: (1) The “this” concept, (2)IIFE (Immediately Invoked Function Expression)Also on Strikingly: https://ryanx94.medium.com/javascript-1-the-this-concept-2-iife-immediately-invoked-function-expression-cceb60252674 更新 新增: 立即函式 IIFE (Immediately Invoked Function Expression) 立即函式 IIFE 對 this 的影響 前言 學習 this 觀念後,後續遇到應用情境,仍似懂非懂,因此歸納統整,儘量明確釐清:(1) this、(2) 前端 Views (MVC Framework)、(3) 物件導向的 Constructor (建構式函式),3者觀念和實務應用情境。 目前自己實務上,常用操作情境和 this 觀念: 前端 Views (MVC Framework): (1) 使用 this 的 Implicit Binding (隱式綁定),即 this 自動指向最近(父層)的 Object。 (2) Controllers 將 Array Data 傳至…Java Script3 min read
Jun 12, 2021Getting data from request(req)Also on Strikingly: https://site-4828247-981-6937.mystrikingly.com/blog/getting-data-from-request-req 更新 新增 URL (取得 “網址” 內容):2-3. req.method (取得 HTTP Method) 前言 Express-Request The req object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on. In this documentation and by convention, the object is always referred to…Request2 min read
Jun 12, 2021JavaScript: Array-related Functions & OperatorsAlso on Strikingly: https://site-4828247-981-6937.mystrikingly.com/blog/javascript-array-related-functions-operators 前言 主要以 3 種方式統整常用陣列相關函數: (1) 歸納功能類別:目前共12種功能分類 (2) 區分相似函數:如 …Arrays4 min read
Jun 11, 2021Database-related KnowledgeAlso on Strikingly: https://site-4828247-981-6937.mystrikingly.com/blog/database-related-knowledge 前言 以 MECE (Mutually Exclusive, Collectively Exhaustive)原則,統整歸納Database 相關知識。 建立 organizational charts(組織架構圖),作為基礎架構,後續維護時,若學習新知,可持續擴充。 Database 分類架構 Data StructureDatabase3 min readDatabase-related KnowledgeAlso on Strikingly: https://site-4828247-981-6937.mystrikingly.com/blog/database-related-knowledge前言以 MECE (Mutually Exclusive, Collectively Exhaustive)原則,統整歸納Database 相關知識。建立 organizational charts(組織架構圖),作為基礎架構,後續維護時,若學習新知,可持續擴充。Database 分類架構Data Structure----
Jun 11, 2021JSON Web Token (JWT) Authentication&CSRF (Cross-site Request Forgery)Also on Strikingly: https://site-4828247-981-6937.mystrikingly.com/blog/json-web-token-jwt-authentication-csrf-cross-site-request-forgery 前言 雖已完成 JSON Web Token (JWT) 登入驗證機制,但一段時間後很容易忘記,因此統整出框架和重要觀念。 MDN-HTTP is stateless, but not sessionless HTTP is stateless: there is no link between two requests being successively carried out on the same connection. 每個 request 獨立,Server 端和 Client 端不保持連線狀態,因此雙方狀態無即時更新。Jwt4 min read