Giter VIP home page Giter VIP logo

team10's Introduction

Build Status

Usage

$ make
$ ./webserver ./demo/config.conf

List of Handlers:

  1. EchoHandler - /echo
  2. StaticHandler - /static/
  3. StatusHandler - /status
  4. NotFoundHandler - any uri not included above

Testing

Integration Test

$ sudo apt-get install python-pip
$ sudo pip install psutil
$ python test.py

Quick Guide to adding new Handlers

  1. Create your handler hpp and cpp files
  2. Add your Handler configuration in the config.conf file
  3. You can add any special behavior with other Handlers in connection.cpp, where the handle_read method will control which Handler to use.

Source Code Structure

Our main.cpp instantiates a Server object, which takes in a ServerConfig object, as well as the host address. The Server then creates a map of pointers to Handlers as per the ServerConfig instructions, which are based off of demo.config.conf.

A connection manager is used to manage multiple connections to server. Each connection is responsible for determining the Handler type it needs to invoke in order to display the information requested. The request and response classes are designed solely to parse and provide information for the connection class to manage.

Code skeleton

http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/examples/cpp03_examples.html

Makefile

http://stackoverflow.com/questions/33282703/running-http-server-example-from-boost-asio

team10's People

Contributors

zxxia avatar kevinwu127 avatar gracetsang avatar

Watchers

James Cloos avatar Stella Chung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.