22
Homework presentation Rapid Web Development with MongoDB and Node.js The Bioinformatics Lab SS 2013 - Wiki topic 12 Tikira Temu 18. June 2013

Homework presentation Rapid Web Development with MongoDB and Node.js

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Homework presentation Rapid Web Development with MongoDB and Node.js

Homework presentationRapid Web Development with MongoDB and

Node.jsThe Bioinformatics Lab SS 2013 - Wiki topic 12

Tikira Temu

18. June 2013

Page 2: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Mongodb

install MongoDB

command linesudo apt-get install mongodb

Get familiar with the shell (Tutorial [1])Add two documents to the collection ’students’

mongoDB shellmanu= name: ’manuel’, age: 24, courses: [’programming’, ’math’]tiki= name: ’tikira’, age: 25, courses: [’informatics’, ’neuroscience’]use biolabdb.students.insert(manu)db.students.insert(tiki)

Tikira Temu Rapid Web Development with MongoDB and Node.js 2

Page 3: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

NodeJS

install NodeJScommand linesudo apt-get install python g++ make checkinstallmkdir /src && cd $_wget -N http://nodejs.org/dist/node-latest.tar.gztar xzvf node-latest.tar.gz && cd node-v*./configurecheckinstall #(remove the "v" in front of the version number)sudo dpkg -i node_*

Tikira Temu Rapid Web Development with MongoDB and Node.js 3

Page 4: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Install the modules express and mongoose

install modulescommand linesudo npm install expresssudo npm install mongoose

check installations

Tikira Temu Rapid Web Development with MongoDB and Node.js 4

Page 5: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Define a mongoose model

Tikira Temu Rapid Web Development with MongoDB and Node.js 5

Page 6: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Define a mongoose model

Tikira Temu Rapid Web Development with MongoDB and Node.js 6

Page 7: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Create event bindings with express for the urls

Tikira Temu Rapid Web Development with MongoDB and Node.js 7

Page 8: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Create event bindings with express for the urls

Tikira Temu Rapid Web Development with MongoDB and Node.js 8

Page 9: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /list

Tikira Temu Rapid Web Development with MongoDB and Node.js 9

Page 10: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /:id

Tikira Temu Rapid Web Development with MongoDB and Node.js 10

Page 11: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /:id/xml

Tikira Temu Rapid Web Development with MongoDB and Node.js 11

Page 12: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /:id/xml

Tikira Temu Rapid Web Development with MongoDB and Node.js 12

Page 13: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /:id/xml

Command line (module installation)sudo npm install jsontoxml

Tikira Temu Rapid Web Development with MongoDB and Node.js 13

Page 14: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /:id/edit

Tikira Temu Rapid Web Development with MongoDB and Node.js 14

Page 15: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /:id/edit

Tikira Temu Rapid Web Development with MongoDB and Node.js 15

Page 16: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /add

Tikira Temu Rapid Web Development with MongoDB and Node.js 16

Page 17: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /add

Tikira Temu Rapid Web Development with MongoDB and Node.js 17

Page 18: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /db

Tikira Temu Rapid Web Development with MongoDB and Node.js 18

Page 19: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

GET /db

Command line (module installation)sudo npm install [email protected]

Tikira Temu Rapid Web Development with MongoDB and Node.js 19

Page 20: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

Add a field visitors in the Student model and count eachtime the /:id page of a student is requested

Tikira Temu Rapid Web Development with MongoDB and Node.js 20

Page 21: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

References

[1] MongoDB Tutorial[2] jsontoxml[3] module: jstoxml[4] module: felixge / node-mysql

Tikira Temu Rapid Web Development with MongoDB and Node.js 21

Page 22: Homework presentation Rapid Web Development with MongoDB and Node.js

Programming challenge

for your attention!

Tikira Temu Rapid Web Development with MongoDB and Node.js 22