06 start node coding

7
Start Node Coding Ahmed Elbassel Email: [email protected] Skype: ahmed_elbassel

Upload: ahmed-elbassel

Post on 19-Mar-2017

51 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: 06 start node coding

Start Node CodingAhmed Elbassel

Email: [email protected]: ahmed_elbassel

Page 2: 06 start node coding

Start Node Coding

- HTTP Server

- HTTP Server - reply with html file

- URIs and Parameters.

Page 3: 06 start node coding

HTTP Server

- Create http server using http package:

Page 4: 06 start node coding

HTTP Server - reply with html file

- Reply with HTML file, use fs package.

- For more about fs package: click here

Page 5: 06 start node coding

URIs and Parameters

Page 6: 06 start node coding

Exercise

- You should write an application that provide api to do the following four operations:

- *, +, -, /

- Your Api should be as the following:

- localhost:3000/calc?num1=4&num2=9&oper=add|mul|sub|div

- Anything other than calc route should return an error message please use the right data.

- If operation other that the above four operation, return an error message displaying that only four operations supported

Page 7: 06 start node coding

Questions