Starting a GenHTTP server instance will always require you to specify the handler that is responsible to generate responses to client requests. Depending on the kind of content you would like to serve (such as a website or a webservice), there are various handlers already available to be used.
Host.Create()
.Handler(...)
.Run();
Handlers are usually made available by an additional nuget module. You can find the modules which are currently available on nuget. To setup a project, you will usually reference the GenHTTP.Core package which includes the engine as well as basic elements for layouting and IO. Additionally, you can choose from several project templates which allow to create new projects for specific use cases within a couple of minutes.
If you would like to have full control over response generation, you can implement a custom handler.
Websites
Allows you to serve a themed web application with basic features such as
templating, theming, sitemaps, or robots instruction files.
Controllers (MVC)
Lightweight layer to write web applications that follow the MVC pattern.
Webservices
Provides REST based web services that can be consumed by clients to
retrieve a JSON or XML serialized result.
Functional Handlers
Allows to respond to HTTP requests in a functional manner, reducing
the boiler code to be written.
Static Websites
Allows to easily serve static web applications such as a Hugo site.
Single Page Applications (SPA)
Allows to serve applications written with modern JS frameworks such as
Vue.js, Angular or React.
Authentication
Restricts the content provided by a section to authenticated users.
Client Caching (Policy)
Instructs the client to cache generated responses for some time.
Client Caching (Validation)
Instructs the client to download files only if they have changed.
Compression
Compresses responses generated by the server to save bandwidth.
CORS
Policies to be respected by browsers accessing resources on the server.
Error Handling
Generate custom HTTP responses for exceptions and missing content.
Server Caching
Caches responses generated by the server to serve them faster the next time they are requested.
Range Support
Enables partial responses if requested by the client.
Custom Concerns
Add behavior to all handlers within a section of your web application.
Defaults
Automatically configures your web server for performance and security.
Layouting
Define the layout of your web application by dividing it into
sections.
Static Content
Serves resources stored in a directory or as embedded resources within an
assembly to the client.
Combined Pages
Allows to assemble a web page from different kind of content.
Downloads
Provides a file to the client as a download. This could be a file from
the file system or from somewhere else.
Redirects
Redirects the client to another location on the server or an
external site.
Directory Browsing
Provides a simple, recursive web view on a directory on the file system.
Reverse Proxies
Relays the request of the client to another server and returns
the response fetched from there.
Virtual Hosts
Allows you to handle requests differently depending on the host specified
by the client. This allows to serve multiple domains using a single
server instance.
Load Balancer
Randomly distributes incoming requests to specified nodes to di stribute the
resulting load to other systems.
Resources
An abstraction layer over file system capabilities to allow binary content
to be fetched from any data source.
Caches
Allow to store intermediate results to improve performance.
Serialization
Controls how input is deserialized and output is serialized.
Injection
Allow to inject custom types into service methods.