diff --git a/cmsc388b/projects/project1/Project1Description.md b/cmsc388b/projects/project1/Project1Description.md new file mode 100644 index 0000000000000000000000000000000000000000..16a5f82a3ff669a77861ce7b159ac52fda34828b --- /dev/null +++ b/cmsc388b/projects/project1/Project1Description.md @@ -0,0 +1,20 @@ +# Project 1: Build your own web client and server + +## Due Date: Thursday, January 10, 2019 8:00 PM +## Objectives: To build your first node application and gain practice with our git workflow for distributiing course materials and submitting projects. + +## Specifications/Requirements +We have provided you with 3 started files: `index.html`, `client.js` and `server.js`. Do not need to modify the `index.html` at all since our automated test scripts use it to validate your project implementation. + +1. `server.js` Build your basic application server to listen on port `8000`. It should have the following functionality: + * It should print out to the console that the server started successfully and what port it is running on. + * It only needs to respond with a request for the contents of the static `index.html` file. If the request is for a file other than `index.html` it should respond with a message to the console with the contents of the error message along with a custom message that the selected resource does not exist on the server. It should also respond to the client with a 404 error. + +2. `client.js` This script will make a request for the resource that your implementation of `server.js` will provide. It needs to do 2 things: + * provide the contents of the http request to the user in the console. + * create a new file called `request.txt` that will contain the results of the http request. + +3. To test your application locally you will need to start your server in one terminal window and then execute your `client.js` script in a separate terminal. + +4. We have provided you with the npm packages you need to use for each script. You are not allowed to add any additional npm packages for your implementaions. + diff --git a/cmsc388b/projects/project1/client.js b/cmsc388b/projects/project1/client.js new file mode 100644 index 0000000000000000000000000000000000000000..ebc131eaedf411fd9656efeec31fe0a9bc7932ac --- /dev/null +++ b/cmsc388b/projects/project1/client.js @@ -0,0 +1 @@ +var http = require('http'); diff --git a/cmsc388b/projects/project1/index.html b/cmsc388b/projects/project1/index.html new file mode 100644 index 0000000000000000000000000000000000000000..54251aeebd76d2211457820c86dea9b0acc5a8c0 --- /dev/null +++ b/cmsc388b/projects/project1/index.html @@ -0,0 +1,9 @@ +<html> + <head> + <title>cmsc388b Project 1</title> + </head> + + <body> + This is the body of the html page for project 1! + </body> +</html> \ No newline at end of file diff --git a/cmsc388b/projects/project1/server.js b/cmsc388b/projects/project1/server.js new file mode 100644 index 0000000000000000000000000000000000000000..a979ec43245b517f3c6b2cee600655ea81d9bf03 --- /dev/null +++ b/cmsc388b/projects/project1/server.js @@ -0,0 +1,3 @@ +var http = require('http'); +var fs = require('fs'); +var url = require('url'); \ No newline at end of file