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
2
450
NTU CCSP 2012Fall - Node.js #2.1 - Simple File Host Service
node.js 0.8 + express 3
Steven Su
October 31, 2012
Tweet
Share
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
290
NTU CCSP 2012Fall - Facebook
xpsteven
1
210
NTU CCSP 2012Fall - Node.js #3 - Mongoose
xpsteven
2
720
NTU CCSP 2012Fall - Node.js #2 - express.js
xpsteven
3
570
Y! Open Hack 2012 Taiwan
xpsteven
0
180
NTU CCSP 2012Fall - Node.js #2 - Advanced Javascript and Node.js
xpsteven
1
540
Other Decks in Programming
See All in Programming
CSC307 Lecture 08
javiergs
PRO
0
690
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
250
AIプロダクト時代のQAエンジニアに求められること
imtnd
1
430
Raku Raku Notion 20260128
hareyakayuruyaka
0
410
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
330
高速開発のためのコード整理術
sutetotanuki
1
430
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
520
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
790
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
870
Event Storming
hschwentner
3
1.3k
iOSアプリでフロントエンドと仲良くする
ryunakayama
0
110
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
160
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
エンジニアに許された特別な時間の終わり
watany
106
230k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
290
What does AI have to do with Human Rights?
axbom
PRO
0
2k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
460
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.6k
A Modern Web Designer's Workflow
chriscoyier
698
190k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
So, you think you're a good person
axbom
PRO
2
1.9k
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: 測試看看