Skip to content

Commit

Permalink
rc-2
Browse files Browse the repository at this point in the history
  • Loading branch information
CypherPotato committed Nov 19, 2023
1 parent 274cc72 commit 9439460
Show file tree
Hide file tree
Showing 17 changed files with 332 additions and 144 deletions.
76 changes: 43 additions & 33 deletions .nuget/README.html
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<title>Features</title>
</head>
<body>

<p>Sisk is a powerful framework for building powerful web applications. It is written in .NET 6 and uses Microsoft-HTTPAPI/2.0 as their main http Engine.</p>
<h2 id="features">Features</h2>
<p><strong>Sisk</strong> is a <strong>web development framework</strong> that is lightweight, agnostic, easy, simple, and robust. The perfect choice for your next project.</p>
<ul>
<li>Multi-platform and cross-operating system</li>
<li>Ultra fast response/second average</li>
<li>Support to operating system's native HTTP interface listener</li>
<li>Sustainable and maintainable</li>
<li>Database-agnostic</li>
<li>Same code implementation for *nix, Mac OS and Windows</li>
<li>Asynchronous request handling</li>
<li>Middlewares, before and/or after request handlers</li>
<li>Configurable error handling</li>
<li>Support to log access/error logs</li>
<li>Easy Cross-Origin Resource Sharing setup</li>
<li>Written in C#</li>
<li><a href="https://sisk.project-principium.dev/">Discover Sisk</a></li>
<li><a href="https://sisk.project-principium.dev/read?q=/contents/docs/welcome.md">Documentation</a></li>
<li><a href="https://github.com/sisk-http/docs/tree/master/archive">Changelog</a></li>
<li><a href="https://sisk.project-principium.dev/read?q=/contents/spec/index.md">Specification</a></li>
<li><a href="https://github.com/sisk-http/benchmarks">Benchmark</a></li>
<li><a href="https://github.com/orgs/sisk-http/projects/1">Roadmap</a></li>
</ul>
<blockquote>
<p>You can use Sisk with HTTPS, HTTP/2 and HTTP/3 QUIC if you follow <a href="https://learn.microsoft.com/en-us/iis/manage/configuring-security/how-to-set-up-ssl-on-iis">this Microsoft tutorial</a>. Requires installation of IIS on Windows.</p>
</blockquote>
<h2 id="documentation">Documentation</h2>
<p>The specification is complete, however, tutorials are yet to come. By the way, you can access the Sisk documentation <a href="https://sisk-http.github.io/docs/static/#/">here</a>.</p>
<p>You can also view release change logs <a href="https://github.com/sisk-http/docs/blob/master/Changelog.md">here</a>.</p>
<h2 id="installation">Installation</h2>
<p>You can install the latest release from Nuget:</p>
<pre><code>PM&gt; dotnet add package Sisk.HttpServer
</code></pre>
<h3 id="documentation">Documentation</h3>
<p>You can get started with Sisk <a href="https://sisk.project-principium.dev/read?q=/contents/docs/getting-started.md">here</a> or build the documentation repository <a href="https://github.com/sisk-http/docs">here</a>.</p>
<p>For information about release notes, changelogs and API breaking changes, see <a href="https://github.com/sisk-http/docs/blob/master/Changelog.md">docs/Changelog.md</a>.</p>
<h2 id="getting-started">Getting started</h2>
<p>The Sisk core idea is to create a service that runs on the internet and follows the pattern you define. Moreover, Sisk is a framework that adapts to how you want it to work, not the other way around.</p>
<p>Due to its explicit nature, its behavior is predictable. The main differentiator from ASP.NET is that Sisk can be up and running in very few lines of code, avoiding unnecessary configurations, and requiring the minimum setup to get your server working. Additionally, it does not demand any additional .NET SDK packages to develop, as the base package of .NET 6 is sufficient to start your development with Sisk.</p>
<p>It can handle multiple requests asynchronously, provides useful tools to manage and accelerate web development.</p>
<pre><code class="lang-c#"><span class="hljs-keyword">using</span> Sisk.Core.Http;
<span class="hljs-keyword">using</span> Sisk.Core.Routing;

<span class="hljs-keyword">namespace</span> <span class="hljs-title">myProgram</span>;

<span class="hljs-keyword">class</span> <span class="hljs-title">Program</span>
{
<span class="hljs-function"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">Main</span>(<span class="hljs-params"><span class="hljs-keyword">string</span>[] args</span>)
</span>{
<span class="hljs-keyword">var</span> app = HttpServer.CreateBuilder();

app.Router += <span class="hljs-keyword">new</span> Route(RouteMethod.Get, <span class="hljs-string">"/"</span>, request =&gt;
{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> HttpResponse(<span class="hljs-number">200</span>)
.WithContent(<span class="hljs-string">"Hello, world!"</span>);
});

</body>
</html>
app.Start();
}
}
</code></pre>
<h2 id="main-features">Main features</h2>
<p>Sisk can do web development the way you want. Create MVC, MVVC, SOLID applications, or any other design pattern you&#39;re interested in.</p>
<ul>
<li><strong>Lightweight:</strong> robust projects tested in small, low-cost, low-performance environments and got good results.</li>
<li><strong>Open-source:</strong> the entire Sisk ecosystem is open source, and all the libraries and technologies we use must be open source as well. Sisk is entirely distributed under the MIT License, which allows the commercial development.</li>
<li><strong>Sustainable:</strong> you are the one who makes the project, Sisk gives you the tools. Because it is open source, the community (including you) can maintain, fix bugs and improve Sisk over time.</li>
</ul>
<h2 id="why-use-sisk-">Why use Sisk?</h2>
<p>Sisk is a highly modular and sustainable framework designed for creating a variety of applications, including Restful applications, gRPC, Websockets, file servers, GraphQL, Entity Framework, and more. Its development is ongoing, with a focus on simplicity, easy maintenance, and an enjoyable experience for developers. Sisk is known for its efficiency, even in low-performance environments, and it can handle over twenty thousand requests per second. The framework is compatible with any machine supporting .NET, including those that do not require Native AOT. Sisk also offers additional implementations and packages for extended functionality.</p>
<p>While Sisk draws inspiration from ASP.NET, it aims for simpler and more performant development without the need for installing additional components. It provides a straightforward and robust development model, allowing developers to handle requests efficiently and explicitly. Sisk simplifies HTTP-related tasks and offers comprehensive documentation and open-source access to its source code, making it accessible and easy to learn for web developers.</p>
74 changes: 29 additions & 45 deletions .nuget/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
**Sisk** is a **web development framework** that is lightweight, agnostic, easy, simple, and robust. Its core idea is to create a service that runs on the internet and follows the pattern you define. Moreover, Sisk is a framework that adapts to how you want it to work, not the other way around.
**Sisk** is a **web development framework** that is lightweight, agnostic, easy, simple, and robust. The perfect choice for your next project.

- [Discover Sisk](https://sisk.project-principium.dev/)
- [Documentation](https://sisk.project-principium.dev/read?q=/contents/docs/welcome.md)
- [Changelog](https://github.com/sisk-http/docs/tree/master/archive)
- [Specification](https://sisk.project-principium.dev/read?q=/contents/spec/index.md)
- [Benchmark](https://github.com/sisk-http/benchmarks)
- [Roadmap](https://github.com/orgs/sisk-http/projects/1)

### Documentation

You can get started with Sisk [here](https://sisk.project-principium.dev/read?q=/contents/docs/getting-started.md) or build the documentation repository [here](https://github.com/sisk-http/docs).

For information about release notes, changelogs and API breaking changes, see [docs/Changelog.md](https://github.com/sisk-http/docs/blob/master/Changelog.md).

## Getting started

The Sisk core idea is to create a service that runs on the internet and follows the pattern you define. Moreover, Sisk is a framework that adapts to how you want it to work, not the other way around.

Due to its explicit nature, its behavior is predictable. The main differentiator from ASP.NET is that Sisk can be up and running in very few lines of code, avoiding unnecessary configurations, and requiring the minimum setup to get your server working. Additionally, it does not demand any additional .NET SDK packages to develop, as the base package of .NET 6 is sufficient to start your development with Sisk.

Expand All @@ -10,27 +27,19 @@ using Sisk.Core.Routing;

namespace myProgram;

public class Program
class Program
{
static void Main(string[] args)
{
HttpServer http = HttpServer.Emit(
insecureHttpPort: 5555,
out HttpServerConfiguration serverConfig,
out ListeningHost listeningHost,
out Router mainRouter
);

mainRouter += new Route(RouteMethod.Get, "/", request =>
var app = HttpServer.CreateBuilder();

app.Router += new Route(RouteMethod.Get, "/", request =>
{
return new HttpResponse(200) { Content = new StringContent("Hello, world!") };
return new HttpResponse(200)
.WithContent("Hello, world!");
});

http.Start();

Console.WriteLine($"HTTP server is listening on {http.ListeningPrefixes[0]}");

Thread.Sleep(-1);
app.Start();
}
}
```
Expand All @@ -39,37 +48,12 @@ public class Program

Sisk can do web development the way you want. Create MVC, MVVC, SOLID applications, or any other design pattern you're interested in.

- **Lightweight:** robust projects tested in small, low-cost, low-performance environments and got good results. The entire Sisk ecosystem is less than 500kb in size!
- **Lightweight:** robust projects tested in small, low-cost, low-performance environments and got good results.
- **Open-source:** the entire Sisk ecosystem is open source, and all the libraries and technologies we use must be open source as well. Sisk is entirely distributed under the MIT License, which allows the commercial development.
- **Sustainable:** you are the one who makes the project, Sisk gives you the tools. Because it is open source, the community (including you) can maintain, fix bugs and improve Sisk over time.

## What is Sisk for?

You can create Restful applications, gRPC, Websockets, file servers, GraphQL, Entity Framework, and more - basically whatever you want. Sisk is an extremely modular and sustainable framework. Furthermore, its current development is intense, and there's much more to be added to Sisk, but the focus is to keep it a simple, easy-to-maintain, and enjoyable framework for developers to start projects of any size.

Sisk was also been tested in low-performance environments, like machines with less than 1GB of RAM, and it can process over twenty thousand requests per second. The code, from arrival on the server to the response, is extremely concise, with very few steps before reaching the client.

One of the pillars of developing with Sisk is compatibility with any machine that supports .NET, including those that do not require Native AOT. Some additional implementations are also provided to the Sisk ecosystem, such as porting projects to other machines with configuration files, a view-engine based on LISP, among others, served with packages beyond the Sisk core package. By design, Sisk is built to work with routers, but don't worry, you are not obligated to use them. Sisk will provide you with all the necessary infrastructure to create a secure application that doesn't obfuscate your code.
## Why use Sisk?

There's no need for excessive ceremony, fluff, or spending hours on boring documentation. Sisk is simple and elegant in its syntax, facilitating the development of fast and complex systems.
Sisk is a highly modular and sustainable framework designed for creating a variety of applications, including Restful applications, gRPC, Websockets, file servers, GraphQL, Entity Framework, and more. Its development is ongoing, with a focus on simplicity, easy maintenance, and an enjoyable experience for developers. Sisk is known for its efficiency, even in low-performance environments, and it can handle over twenty thousand requests per second. The framework is compatible with any machine supporting .NET, including those that do not require Native AOT. Sisk also offers additional implementations and packages for extended functionality.

## But why not just use ASP.NET?

ASP.NET is an great and well-established web framework, and many features present in Sisk were inspired by it. However, Sisk focuses on simpler and more performant development, eliminating the need for installing additional components in your system, project, editor, etc. Sisk was designed to be straightforward and robust, enabling the creation of anything you desire.

Moreover, its development model allows you to choose how you want your development to be. You handle requests in a simple, efficient, explicit, and fast manner. Knowledge and understanding of HTTP are required if you want to do everything manually, and even then, Sisk can greatly simplify things with all the functions it provides in its core package.

Getting started with Sisk is easy. Those who already have experience with web development typically learn Sisk in one or two days. Our documentation is… let's say… very well-documented. You can find everything you need here. Additionally, our source code is open, so you have access to it.

## Documentation

You can get started [here](https://sisk.project-principium.dev/read?q=/contents/docs/getting-started.md) or access the documentation repository [here](https://github.com/sisk-http/docs).


## Installation

You can install the latest release from Nuget packages:

```
PM> NuGet\Install-Package Sisk.HttpServer
```
While Sisk draws inspiration from ASP.NET, it aims for simpler and more performant development without the need for installing additional components. It provides a straightforward and robust development model, allowing developers to handle requests efficiently and explicitly. Sisk simplifies HTTP-related tasks and offers comprehensive documentation and open-source access to its source code, making it accessible and easy to learn for web developers.
52 changes: 52 additions & 0 deletions core.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sisk.Core", "src\Sisk.Core.csproj", "{A72A8C66-1CAD-47F1-A1DF-7686EE951FE2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{FF6E673A-4CCA-43AA-A391-9BB28F5D67A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sisk.BasicAuth", "extensions\Sisk.BasicAuth\Sisk.BasicAuth.csproj", "{2988DA80-828F-4CF1-8E20-A83DB35C7B67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sisk.ServiceProvider", "extensions\Sisk.ServiceProvider\Sisk.ServiceProvider.csproj", "{D559DBC8-64FF-4242-B10C-7D595584FE5B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{50F58A99-47F5-4CDA-B858-39B04912CAE2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeAOT_Test", "tests\NativeAOT_Test\NativeAOT_Test.csproj", "{B42CD5B9-E25B-4C47-B951-ED9D58E5C8B8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A72A8C66-1CAD-47F1-A1DF-7686EE951FE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A72A8C66-1CAD-47F1-A1DF-7686EE951FE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A72A8C66-1CAD-47F1-A1DF-7686EE951FE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A72A8C66-1CAD-47F1-A1DF-7686EE951FE2}.Release|Any CPU.Build.0 = Release|Any CPU
{2988DA80-828F-4CF1-8E20-A83DB35C7B67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2988DA80-828F-4CF1-8E20-A83DB35C7B67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2988DA80-828F-4CF1-8E20-A83DB35C7B67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2988DA80-828F-4CF1-8E20-A83DB35C7B67}.Release|Any CPU.Build.0 = Release|Any CPU
{D559DBC8-64FF-4242-B10C-7D595584FE5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D559DBC8-64FF-4242-B10C-7D595584FE5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D559DBC8-64FF-4242-B10C-7D595584FE5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D559DBC8-64FF-4242-B10C-7D595584FE5B}.Release|Any CPU.Build.0 = Release|Any CPU
{B42CD5B9-E25B-4C47-B951-ED9D58E5C8B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B42CD5B9-E25B-4C47-B951-ED9D58E5C8B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B42CD5B9-E25B-4C47-B951-ED9D58E5C8B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B42CD5B9-E25B-4C47-B951-ED9D58E5C8B8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2988DA80-828F-4CF1-8E20-A83DB35C7B67} = {FF6E673A-4CCA-43AA-A391-9BB28F5D67A5}
{D559DBC8-64FF-4242-B10C-7D595584FE5B} = {FF6E673A-4CCA-43AA-A391-9BB28F5D67A5}
{B42CD5B9-E25B-4C47-B951-ED9D58E5C8B8} = {50F58A99-47F5-4CDA-B858-39B04912CAE2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0763848A-673A-4233-A0FF-C0D7A8F8D722}
EndGlobalSection
EndGlobal
10 changes: 7 additions & 3 deletions src/Http/Hosting/HttpServerHostContextBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ internal HttpServerHostContextBuilder()
/// </type>
public HttpServerHostContext Build()
{
_portableConfiguration?.Build();
return _context;
}

Expand All @@ -93,6 +92,10 @@ public void UseBootstraper(Action bootstrapAction)
/// Enables the portable configuration for this application, which imports settings, parameters,
/// and other information from a JSON settings file.
/// </summary>
/// <remarks>
/// This method overrides almost all of your <see cref="HttpServer.CreateBuilder()"/> configuration. To avoid this,
/// call this method at the beginning of your builder, as the first immediate method.
/// </remarks>
/// <param name="portableConfigHandler">The handler of <see cref="PortableConfigurationBuilder"/>.</param>
/// <definition>
/// public void UsePortableConfiguration(Action{{PortableConfigurationBuilder}} portableConfigHandler)
Expand All @@ -106,6 +109,7 @@ public void UsePortableConfiguration(Action<PortableConfigurationBuilder> portab
try
{
portableConfigHandler(_portableConfiguration);
_portableConfiguration.Build();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -278,7 +282,7 @@ public void UseRouter(Action<Router> handler)
/// Method
/// </type>
[RequiresUnreferencedCode(SR.Router_AutoScanModules_RequiresUnreferencedCode)]
public void UseAutoScan<TModule>(bool activateInstances = true) where TModule : RouterModule, new()
public void UseAutoScan<TModule>(bool activateInstances = true) where TModule : RouterModule
{
_context.Router.AutoScanModules<TModule>(typeof(TModule).Assembly, activateInstances);
}
Expand All @@ -296,7 +300,7 @@ public void UseRouter(Action<Router> handler)
/// Method
/// </type>
[RequiresUnreferencedCode(SR.Router_AutoScanModules_RequiresUnreferencedCode)]
public void UseAutoScan<TModule>(Assembly t, bool activateInstances = true) where TModule : RouterModule, new()
public void UseAutoScan<TModule>(Assembly t, bool activateInstances = true) where TModule : RouterModule
{
_context.Router.AutoScanModules<TModule>(t, activateInstances);
}
Expand Down
Loading

0 comments on commit 9439460

Please sign in to comment.