Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Service Installation and Configuration

Similar presentations


Presentation on theme: "Web Service Installation and Configuration"— Presentation transcript:

1 Web Service Installation and Configuration
MIS 3406 Department of MIS Fox School of Business Temple University

2 GuessANumber Port 80 Port 8080

3 Poke a few holes in the firewalls
Serving up GuessANumber.html Open up port 80 (if you didn’t when you created –IIS) on the Azure firewall Check to make sure port 80 is open on the Windows firewall Talking to GuessANumber.js Open up port 8080 on the Azure firewall Open up port 8080 on the Windows firewall

4 GuessANumber.html Code Review
Standard stuff from 2402 Very basic HTML. A few buttons and a place to enter a number What we really care about!

5 GuessANumber.html Code Review
Declare a few variables and point to our nodejs server Generate a random number and tell our nodjs server to start a new game Send our guess and display the result

6 GuessANumber.html Store GuessANumber.html in C:\inetpub\wwwroot on TUA12345-IIS1

7 GuessANumber.js Code Review
We’ll use express to route requests and body-parser to make it easy to read data passed to us Set body-parser up to deal with both urlencoded data and data in json format

8 GuessANumber.js Code Review
CORS takes care of browser security issues when data is passed between domains

9 GuessANumber.js Code Review
Do 3 things when we receive a “startGame” request: Generate a random number between 1 and 100 Write that random number to a .NumberToGuess file Send the “Game started” message back to the client

10 GuessANumber.js Code Review
When we receive a “guessMade” request…: Tell them they guessed too low or… Tell them that they guessed too high or… Tell them they guessed correctly and delete the .NumberToGuess file

11 GuessANumber.js Code Review
Wait for “startGame” and “guessMade” requests. Express will route requests to the right block of node.js code

12 GuessANumber.js Store GuessANumber.js in the directory created for Node.js code in Tech Challenge #6 Fire it up


Download ppt "Web Service Installation and Configuration"

Similar presentations


Ads by Google