Wire.NET 0.6.0

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

Wire <img src="https://raw.githubusercontent.com/SperoSophia/Wire/master/icon.png" width="24">

Build status nuget

Wire is a quick, easy & extremely light-weight WebAPI framework. As an alternative to ASP.NET MVC, NancyFx, Nina, Sinatra and others. .NET based ofc.

Setup

PM> Install-Package Wire.NET

Code Example

Wire Supports all the standard http requests, GET, POST, PUT, DELETE, OPTIONS, PATCH. and setting up a request is fast too.

using Wire;

// Start the server
var server = new WireHTTPServer();

// Sample API endpoint
API.GET("/info/{message}", x => new { Message = x.Parameters.message });

// Wait for key press to terminate program
server.Wait();

so in the example of http://localhost/info/OK would return a json reponse as { Message: "OK" }

API.POST("/blog/post", x => BlogRepository.Save(x.Body.As<Post>()));

Save the body of the post to your post repositoty in this instance.

API.GET("/blog/posts", x => MyBlogPosts.Where(y => y.name.contains(x.QueryString["q"]))));

If we need to filter something out. in the case of http://localhost/blog/posts?q=first

Motivation

I like that the core essential need of applications to have a web endpoint. so a console app can have a single json endpoint as sampled above without the need of a huge and heavy framework as ASP.NET MVC. I liked how nancy decorated the reqests in to action parameters. It gave an illution of control. Modules and bootstraps. I needed a neat solution where i just throw a request to an object as above. which can be incrementally added.

for(int i = 0; i < 10; i++) {
   API.GET("/"+i, x => new { Count = ${i} });
}

API bindings can be replaced runtime as well, so if something is mapped to /hello and you map another function to an existing mapping its replaced.

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 was computed.  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.  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
0.6.0 573 7/27/2022
0.5.1 514 7/20/2022
0.5.0 532 7/20/2022
0.4.1 859 2/27/2019
0.4.0 724 2/27/2019
0.3.39 1,363 2/24/2018
0.3.38 1,358 2/15/2018
0.3.37 1,372 2/11/2018
0.3.36 1,370 12/20/2017
0.3.35 1,392 12/13/2017
0.3.33 1,152 10/26/2017
0.3.32 1,088 10/26/2017
0.3.31 1,096 10/26/2017
0.2.0 1,375 10/25/2017