Roi Barank, Abineet Das Sharma, Suchit Panjiyar
Team Razzle-Dazzle
UCLA CS 130: Software Engineering
Winter 2017

Source Code Layout:
  1. The server is primarily run by two classes, namely server and connection. The server class takes in a semi-processed config file in the form of child blocks. The server constructor parses these blocks to pull out the port number and initialize a map of request handlers requested by the config file. It then starts up the server on the desired port, and initializes a connection, that processes everything that is sent to the server over the socket.
  
  2. The server constructs a unordered_map from uri_prefixes to RequestHandler pointers of the correct type. These are used by the connection to point requests to the correct handler type. The connection class checks the return status of the HandleRequest of the handler, which if not OK sets response to bad request/file not found depending on the situation.
  
  3. All request handlers share a common API and inherit from a RequestHandler class that defines this API. Handlers are created on basis of a prefix matching done between the handler names in the config file and the names of the handlers we have available. 

  4. Handlers:
	-EchoHandler: Echo's back the sent request into the body of the response in plain text.
	-StaticHandler: Used for serving files. Fetches files on the basis of prefix called. Each prefix matches to a source directory. There is a separate instance of each StaticHandler for each source directory.
	-StatusHandler: Returns in plain text data about the previous requests received by the server.
	-NotFoundHandler: Sets response to a 404 Not Found with a standard HTML.
	-ProxyHandler: Issue requests and parse the responses 
			
			
Instructions:
	- Fork our repository. Make any contributions.
	
  Build:
	-Run "make" to build.
	-Run "make run" to build and run in one go.
  Tests:
	-Run "make test" to run tests.
	-Run "make coverage" to run gcov for test coverage.
	
  Deploy:
  	-Run "make deploy" to create the docker image.
	-Run "make push_depoy" to push the docker image to AWS and run the docker image.
	( Please request pem file or push to your EC2 server).

Parser for nginx config files inspired by https://github.com/fatiherikli/nginxparser.

Includes code from googletest-1.7.0. See https://code.google.com/p/googletest/

Web Server largely inspired by Boost Official Examples : 
http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio/example/cpp11/http/server/server.cpp
http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio/example/cpp11/http/server/connection.cpp