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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Steven Su
October 31, 2012
Programming
460
2
Share
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
210
NTU CCSP 2012Fall - Node.js #3 - Mongoose
xpsteven
2
730
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
550
Other Decks in Programming
See All in Programming
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
CSC307 Lecture 17
javiergs
PRO
0
260
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
310
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
AI駆動開発勉強会 広島支部 第一回勉強会 AI駆動開発概要とワークショップ
hayatoshimiu
0
400
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
310
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
3.8k
JavaDoc 再入門
nagise
0
200
iOS26時代の新規アプリ開発
yuukiw00w
0
210
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
120
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.3k
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
Featured
See All Featured
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
How to Talk to Developers About Accessibility
jct
2
210
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
120
The Curse of the Amulet
leimatthew05
1
13k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Become a Pro
speakerdeck
PRO
31
6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
160
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
It's Worth the Effort
3n
188
29k
HDC tutorial
michielstock
2
680
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
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: 測試看看