From 2eb3ed38c46c53266d6e23245b638027f4be3354 Mon Sep 17 00:00:00 2001 From: Andrej Rasevic <andrej@rasevicengineering.com> Date: Tue, 8 Jan 2019 11:23:15 -0500 Subject: [PATCH] adding project1 cmsc388b --- .../projects/project1/Project1Description.md | 20 +++++++++++++++++++ cmsc388b/projects/project1/client.js | 1 + cmsc388b/projects/project1/index.html | 9 +++++++++ cmsc388b/projects/project1/server.js | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 cmsc388b/projects/project1/Project1Description.md create mode 100644 cmsc388b/projects/project1/client.js create mode 100644 cmsc388b/projects/project1/index.html create mode 100644 cmsc388b/projects/project1/server.js diff --git a/cmsc388b/projects/project1/Project1Description.md b/cmsc388b/projects/project1/Project1Description.md new file mode 100644 index 0000000..16a5f82 --- /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 0000000..ebc131e --- /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 0000000..54251ae --- /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 0000000..a979ec4 --- /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 -- GitLab