GithubHelp home page GithubHelp logo

gerhobbelt / genhttp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaliumhexacyanoferrat/genhttp

0.0 0.0 0.0 9.21 MB

Lightweight web server written in pure C# with few dependencies to 3rd-party libraries.

Home Page: https://genhttp.org

License: MIT License

C# 99.62% HTML 0.25% JavaScript 0.13%

genhttp's Introduction

GenHTTP Webserver

GenHTTP is a lightweight web server written in pure C# with few dependencies to 3rd-party libraries. The main purpose of this project is to serve small web applications and web services written in .NET, allowing developers to concentrate on the functionality rather than on handling the infrastructure.

As an example, the website of this project is hosted on a Raspberry Pi: genhttp.org

CI Coverage nuget Package

Features

  • Setup new webservices or websites in a couple of minutes using project templates
  • Optimized out of the box (e.g. by bundling resources or compressing results)
  • Small memory and storage footprint
  • Several themes available to be chosen from
  • Grade A+ security level according to SSL Labs

Getting Started

After you added a reference to the GenHTTP.Core nuget package, you can spawn a new server instance with just a few lines of code:

var content = Content.From(Resource.FromString("Hello World!"));

Host.Create()
    .Handler(content)
    .Run();

When you run this sample it can be accessed in the browser via http://localhost:8080. The documentation provides a step-by-step starting guide as well as additional information on how to implement webservices, websites, MVC style projects, or single page applications and how to host your application via Docker.

Building the Server

To build the server from source, clone this repository and run the playground project launcher for .NET 5:

git clone https://github.com/Kaliumhexacyanoferrat/GenHTTP.git
cd ./GenHTTP/Playground
dotnet run

This will build the playground project launcher for .NET Core with all the server dependencies and launch the server process on port 8080. You can access the playground in the browser via http://localhost:8080.

If you would like to contribute, see the contribution guidelines.

History

The web server was originally developed in 2008 to run on a netbook with an Intel Atom processor. Both IIS and Apache failed to render dynamic pages on such a slow CPU back then. The original project description can still be found on archive.org. In 2019, the source code has been moved to GitHub with the goal to rework the project to be able to run dockerized web applications written in C#.

Links

Thanks

genhttp's People

Contributors

dependabot[bot] avatar fossabot avatar kaliumhexacyanoferrat avatar monodepth avatar nm-naegeli avatar ondator 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.