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
Steven Su
October 31, 2012
Programming
2
440
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
190
NTU CCSP 2012Fall - Node.js #3 - Mongoose
xpsteven
2
710
NTU CCSP 2012Fall - Node.js #2 - express.js
xpsteven
3
560
Y! Open Hack 2012 Taiwan
xpsteven
0
170
NTU CCSP 2012Fall - Node.js #2 - Advanced Javascript and Node.js
xpsteven
1
520
Other Decks in Programming
See All in Programming
チームの境界をブチ抜いていけ
tokai235
0
220
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
13
44k
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
4.9k
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
8.3k
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
180
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
640
Ktorで簡単AIアプリケーション
tsukakei
0
100
マンガアプリViewerの大画面対応を考える
kk__777
0
150
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
340
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
2
370
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
250
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
200
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
What's in a price? How to price your products and services
michaelherold
246
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
930
Product Roadmaps are Hard
iamctodd
PRO
55
11k
Building Adaptive Systems
keathley
44
2.8k
KATA
mclloyd
PRO
32
15k
The Pragmatic Product Professional
lauravandoore
36
7k
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: 測試看看