Stratus 1.0.2
dotnet add package Stratus --version 1.0.2
NuGet\Install-Package Stratus -Version 1.0.2
<PackageReference Include="Stratus" Version="1.0.2" />
<PackageVersion Include="Stratus" Version="1.0.2" />
<PackageReference Include="Stratus" />
paket add Stratus --version 1.0.2
#r "nuget: Stratus, 1.0.2"
#:package Stratus@1.0.2
#addin nuget:?package=Stratus&version=1.0.2
#tool nuget:?package=Stratus&version=1.0.2
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 | Versions 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. |
-
net8.0
- Handlebars.Net (>= 2.1.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.