The basic server is based on sample code provided by Vonage. The server is hosted using Heroku at the address https://pinmi-node-server.herokuapp.com/. The sample code also comes with some files that display a front end if you were to look at the given server URL in a browser. It uses Express to create server routes. You can learn more about Express routes here. In short, each route is a function that is written to handle http requests to the routes associated URL. The current routes that the server serves are the following:
- GET ‘/’
- GET ‘/Session’
- GET ‘/room/:name'
- POST '/archive/start'
- POST '/archive/:archiveId/stop'
- GET '/archive/:archiveId/view'
- GET '/archive/:archiveId'
- POST '/enteredRoom/:userMode/:sessionID'
- POST '/exitedRoom/:userMode/:sessionID'
- GET '/isRoomEmpty/:sessionID'
- GET '/s3/:archiveId'
Each of the routes listed above is connected to a function. To run that function on the server, you make an http request using the base url of the server, and the extension listed above (ex: "https://pinmi-node-server.herokuapp.com" + "/Session"). We are currently making HTTP requests from the client to the server by using the Fetch API.