GithubHelp home page GithubHelp logo

natalieethell / mr.-robot-et-al. Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ucla-cs130/mr.-robot-et-al.

0.0 3.0 0.0 2.89 MB

:zap: Lightning is a modern, robust web server written in C++.

License: GNU General Public License v3.0

Makefile 3.48% Shell 0.47% Python 1.73% C++ 94.18% HTML 0.14%

mr.-robot-et-al.'s Introduction

Lightning in a Bottle

โšก Lightning is a modern, robust web server written in C++.

Setup

Supported systems

Ubuntu 14.04

Installation

$ git clone --recursive [email protected]:UCLA-CS130/Mr.-Robot-et-al..git

Dependencies

We have the following dependencies:

  • Boost: used for socket networking as well as string manipulation.
  • Lcov: used to create test coverage webpages.
  • Python 3.6: Our integration test that uses methods not supported in version of Python earlier than 3.6
  • httpie: a handy tool for checking http connections that we use in our integration test.

To install these dependencies, simply run ./configure.sh

Usage

To following is an example of how to build and run LightningServer. It takes in one argument, the server configuration file (the format of which can be found in the wiki).

$ make
$ ./lightning [config file]

A basic config file that we included is simple_config. It contains configurations for all our curent handlers, and specifies port 2020.

To clean everything up:

$ make clean

To run only integration tests

$ make integration_test

To run both unit and integration tests (make sure to run make clean first if its not the first time running the tests):

$ make test

Contributing

Soure Code Layout

Currently most of our source files are stored in our root directory. The provided nginx-configparser source files are in the nginx-configparser submodule which also contains the GTest submodule.

The following illustrates the hierarchy of .cc files as they are called when running the server.

lightning_main
  lightning_server      (listens on socket specified by config file)
    server_config       (wrapper for NginxConfig to make it easier to get properties)
    request_router      (initializes long-lived handlers)
      request
      response
      request_handlers

Adding a Handler

In order to add a new handler, you will need to first create a class definition and implementation for it in request_handlers.h and request_handlers.cc files. We have a abstract base class called RequestHandler that contains the enums and initializes the handler. Your handler will be derived from this class. EchoRequestHandler is a good example of how this can be done. Each new handler will call the init member function and implement the handleRequest member function.

Once you are done with making your handler, you can use it by running the server with a config file that gives your handler a path. See simple_config for examples of previous handler paths.

Authors:

  • Alex Fong
  • Frank Chen
  • Ky-Cuong Huynh

mr.-robot-et-al.'s People

Contributors

apfong avatar kfrankc avatar kycodehuynh avatar

Watchers

 avatar  avatar  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.