SAPI 10.0.0

dotnet add package SAPI --version 10.0.0
                    
NuGet\Install-Package SAPI -Version 10.0.0
                    
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="SAPI" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SAPI" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SAPI" />
                    
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 SAPI --version 10.0.0
                    
#r "nuget: SAPI, 10.0.0"
                    
#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.
#addin nuget:?package=SAPI&version=10.0.0
                    
Install SAPI as a Cake Addin
#tool nuget:?package=SAPI&version=10.0.0
                    
Install SAPI as a Cake Tool

SAPI - Simple API

Nuget NuGet GitHub

SAPI is a library for creating APIs with C#. It's simple by design and allows for a lot of flexibility.

Installation

Add as dependency in NuGet

Install-Package SAPI -ProjectName <project>

In your preferred IDE: SAPI in rider's NuGet PM

By downloading and referencing the DLL in your project.

Usage

For detailed explanation You can also see wiki

// Program.cs
using SAPI;
using SAPI.Endpoints;
using Project.Endpoints;

public static void Main(string[] args)
{
    // Init SAPI
    Server sapi = new();
    
    // Mount endpoints(routes)
    sapi.MountEndpoint(new Ping());
    
    
    // Start SAPI
    sapi.Start();
}
// Endpoints/Ping.cs
using System.Net;
using SAPI.Endpoints;
using SAPI.Utilities;

namespace Project.Endpoints
{
    public class Ping : IEndpoint
    {
        public string url { get; } = "ping";
        public Method method { get; } = Method.GET;

        public override void Task(ref HttpListenerRequest request, ref HttpListenerResponse response, Dictionary<string, string> parameters)
        {
            Console.WriteLine("Ping!");
            
            Utilities.HtmlResponse("Pong!", ref response);
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SAPI:

Package Downloads
SharpSSR

SharpSSR is a web framework for building Server Side Rendered apps.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
10.0.0 478 7/26/2023
9.1.0 245 5/15/2023
9.0.0 221 5/4/2023
8.0.0 197 5/1/2023
7.0.0 227 4/25/2023
6.0.0 244 3/11/2023
6.0.0-experimental 178 2/8/2023
5.0.1 249 12/24/2022
5.0.0 238 12/6/2022
4.0.0 280 11/9/2022
3.0.0 267 11/6/2022
2.2.0 243 10/31/2022
2.1.0 284 10/5/2022
2.0.0 273 9/28/2022
1.2.0 303 9/15/2022
1.1.0 321 9/14/2022
1.0.0 339 9/14/2022