Top Banner
Lesson 3 Express 與 MongoDB 與與與與 By BigQ
40

nodejs -『PVD+』團隊內部Lesson3

May 24, 2015

Download

Technology

Mark Ven

『PVD+』實習生 許鈺群「BigQ」製作
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 1. Lesson 3 Express MongoDB By BigQ

2. Content Express --MongoDB 3. Express npmexpress npm install g express 4. Express Express Jadeejs ejs 5. Express 6. Express ejsexpress!!? npm installpackage.json 7. Express !! 8. HTML HTML HTML 9. JavaScript Express JavaScript HTML HTML 10. 11. app.js / /u/:user /post /reg /login /logout 12. routes/index.js 13. -Bootstrap Twitter Bootstrap 14. -Boostrap 15. -Bootstrap imgpublic bootstrap.js.jspublic/javascript bootstrap.css.csspublic/stylesheets jQuerry.js public/javascript 16. view/index.ejs 17. view/index.ejs Container Footer 18. 19. MongoDB 20. -MongoDB MongoDB mongodb c c:mongodb MongoDB MongoDB c:datadb C 21. -MongoDB c:mongodbbin mongod.exe MongoDB mongo.exe MongoDB ! 22. Node.jsMongoDB package.json npm install 23. Setting.js cookieSecret Cookie Db Host 24. midelsdb.js 25. Express MongoDB ! 26. connect-mongo package.jsonnpm install 27. app.js cookieParser() Cookie session() MongoStore 28. views/reg.ejs POST 29. Username Password Password-repeat type 30. 31. 32. POST routes/index.js /regPOST 33. req.bodyPOST req.flashExpress 34. req.redirect CryptoNodejs crypto 35. User.get User.save req.session.user = newUser 36. User modelsuser.jsUser 37. code User.prototype.save Uset.get 38. Uset.get 39. ! 40.