Stratus 1.0.2

dotnet add package Stratus --version 1.0.2
                    
NuGet\Install-Package Stratus -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Stratus" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Stratus" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Stratus" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Stratus --version 1.0.2
                    
#r "nuget: Stratus, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Stratus@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Stratus&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Stratus&version=1.0.2
                    
Install as a Cake Tool

Stratus Documentation

Welcome to the official documentation for Stratus, an ultra-lightweight .NET backend framework designed for flexibility, performance, and ease of use.

Stratus provides a simple and customizable structure that allows developers to create their own routers and rendering engines through intuitive interfaces, rather than being forced to work within rigid structures. It�s built to give you full control over your application, ensuring you can design it exactly how you want.

Installation

Package Manager (PM)

NuGet\Install-Package Stratus -Version 1.0.0

dotnet CLI

dotnet add package Stratus --version 1.0.0

PackageReference

<PackageReference Include="Stratus" Version="1.0.0" />

Setup

using Stratus;
public static class Program {
	public async static Task Main(string[] args) {
		// Create a new instance of the server
		Server server = new();

		// Define a GET route for the home page
		server.Router.Get("/", (context, parameters) => {
			// Return a simple HTML response
			return server.BakeHtml(
				@"<!DOCTYPE html>
				<html>
				<body>
					<h1>My First Heading </h1>
					<p>My first paragraph.</p>
				</body>
				</html>", 200);
		});

		// Define a GET route with dynamic parameters for a product page
		server.Router.Get("/product/{section}/{item}", (context, parameters) => {
			// Use dynamic route parameters to customize the HTML content
			return server.BakeHtml(
				$@"<!DOCTYPE html>
				<html>
				<body>
					<h1>{parameters["section"]}</h1>
					<p>{parameters["item"]}</p>
				</body>
				</html>", 200);
		});

		// Define a POST route to respond with JSON
		server.Router.Post("/hello", (context, parameters) => {
			// Create an anonymous object to send as JSON
			object json = new {
				hello = "world!"
			};

			// Return the JSON response
			return server.BakeJson(json, 200);
		});

		// Start the server
		await server.Start();
	}

}

Tips for Managing wwwroot Folder in .NET Projects

If you want to automatically copy the contents of your wwwroot folder to the build output directory during the build process, you can add the following snippet to your .csproj file. This will ensure that all files in the wwwroot directory are included in the build output.

Note: This approach will not delete any files from the output's wwwroot folder, so if you need to remove any files manually, you will have to do so separately.

Add the following to your .csproj file:

<ItemGroup>
  <None Update="wwwroot\**">
    <CopyToOutputDirectory>Always</CopyToOutputDirectory>
  </None>
</ItemGroup>
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 166 12/4/2024
1.0.1 152 12/4/2024
1.0.0 160 12/3/2024