Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NTU CCSP 2012Fall - Node.js #2.1 - Simple File ...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Steven Su
October 31, 2012
Programming
460
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
NTU CCSP 2012Fall - Node.js #2.1 - Simple File Host Service
node.js 0.8 + express 3
Steven Su
October 31, 2012
More Decks by Steven Su
See All by Steven Su
JSDC.TW 2013 Node.js佈署心得
xpsteven
14
1.2k
NTU CCSP 2012Fall - Mobile Web入門 回首網頁開發
xpsteven
3
320
NTU CCSP 2012Fall - Facebook
xpsteven
1
220
NTU CCSP 2012Fall - Node.js #3 - Mongoose
xpsteven
2
740
NTU CCSP 2012Fall - Node.js #2 - express.js
xpsteven
3
580
Y! Open Hack 2012 Taiwan
xpsteven
0
200
NTU CCSP 2012Fall - Node.js #2 - Advanced Javascript and Node.js
xpsteven
1
560
Other Decks in Programming
See All in Programming
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
130
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
120
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
270
The NotImplementedError Problem in Ruby
koic
1
800
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
130
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
140
Oxlintのカスタムルールの現況
syumai
6
1.1k
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
OSもどきOS
arkw
0
570
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
110
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
240
Featured
See All Featured
HDC tutorial
michielstock
2
710
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Designing Powerful Visuals for Engaging Learning
tmiket
1
410
My Coaching Mixtape
mlcsv
0
150
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
170
Technical Leadership for Architectural Decision Making
baasie
3
410
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Transcript
簡易檔案上傳網站
目標 • 可以上傳檔案並給名稱 • 可以清單顯示已經上傳的檔案 • 可以顯示已經上傳的檔案
環境 • Windows 7 • Sublime Text 2 • Node.js
0.8.x • Express.js 3.0
要求 • 安裝好node 0.8.x • 可以使用npm指令 • 可以使用node指令
Step 0: 安裝express 打開終端機 輸入 npm install express –g -g也可以放install前面
-g代表安裝到global 才可以在任何資料夾當作指 令來使用 簡單說就是安裝程式到系統
Step 0: 安裝express
Step 1: 建立專案 測試express指令
Step 1: 建立專案 express -e -c less -s uploadserver
Step 2: 安裝所需要的庫 npm install 會自動依照目錄下 的package.json安裝所依賴的 套件到目前目錄(local mode)
Step 3: 驗證安裝 node app.js 打開瀏覽器 http://localhost:3000/
Step 4: 打開ST2 以資料夾模式開啟
Step 5: 編輯bodyParser 修改bodyParser keepExtensions => 保留附檔名 uploadDir => 指定上傳到哪個資料夾
Step 6: 接受上傳 var database 模擬一個資料庫 res.redirect(路徑) 回傳302導向其他 網頁
Step 7: 修改index view
Step 8: 測試看看吧
Step 9: 修改index的handler
Step 10: 再修改index.ejs
Step 11: 測試看看