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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
今さら聞けないCancellationToken
htkym
0
200
New "Type" system on PicoRuby
pocke
1
320
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.4k
RTSPクライアントを自作してみた話
simotin13
0
310
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
210
AI Agent と正しく分析するための環境作り
yoshyum
3
630
ふつうのFeature Flag実践入門
irof
7
3.3k
GitHub Copilot CLIのいいところ
htkym
2
1.2k
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
470
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
1.6k
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
370
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.8k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
190
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
160
Between Models and Reality
mayunak
4
310
Site-Speed That Sticks
csswizardry
13
1.2k
30 Presentation Tips
portentint
PRO
1
300
Amusing Abliteration
ianozsvald
1
190
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
A better future with KSS
kneath
240
18k
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: 測試看看