Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Application of nodejs in epsilon mobile

799 views

Published on

Published in: Technology, Education

Application of nodejs in epsilon mobile

  1. 1. Application of node js in Epsilon Mobile
  2. 2. Outline • Nodejs • NodeJs deployment • Expressjs • Epsilon’s choices – Back-end – Front-end – Integrate with jenkins
  3. 3. NodeJs • Event-driven I/O server-side JavaScript environment based on V8 engine.
  4. 4. Create basic hello world sever • Put the code below into app.js file • Run command node app.js
  5. 5. Socket io for socket server • Put the code below into app.js file • Run command node app.js
  6. 6. • Node.js uses an event-driven, non-blocking I/O model -> better than the traditional thread-based server.
  7. 7. Extensible • Easy to install and easy to use. • There’re already a lot of packages out there.
  8. 8. Express.js • web application framework for nodejs – Routes – Serve static file vs serve dynamic files – User authentication – Body parser
  9. 9. Express.js - routes
  10. 10. Express.js - Serve static files
  11. 11. User authentication • Use basic authentication
  12. 12. • Middleware
  13. 13. Body parser • Decide where to put the upload file • Then, the files’ information will be parsed, the file’s name will be hash.
  14. 14. Extensible • Body parser is extensible. • Template engine is also extensible.
  15. 15. Epsilon choices Back-end •nodejs •Expressjs •CoffeeScript, jade •Mocha, superagent, should Front-end •backbone •Jquery •Mocha, sinon, require Others •Jenkins •JSInt (maybe) •JSDuck (maybe)
  16. 16. Testing for back-end • mocha + superagent + should
  17. 17. Testing for front-end • mocha + require + sinon – We’re still working on this one.
  18. 18. spec_runner.js
  19. 19. test_runner.html
  20. 20. Integrate with Jenkins for continuous integration
  21. 21. Our next problems • Trying to setup a Continuous Integration and Continuous Deployment. • Reuse code between server and client. • Generate documents from codes.

×