Installing
Make sure .Net SDK is available
Swytch a .NET C# Web framework, hence to use it you'll need the .NET SDK installed on your machine. If you don't, you can download and install it from the official .NET website.
Once installed, verify the installation by running
dotnet --version
Create A Project
The foundation of a swytch app is nothing but a console application. So we shall create a simple boring console app and then supercharge it with all the amazing features Swytch has to offer.
Note that Swytch has starter templates that can be used to quickly bootstrap a project and get up and running quickly. We shall later take a look at that under the Swytch templates section but for now let's set up everything from the ground up to have a better perspective into what makes a Swytch application.
First create a console application like you always do
dotnet new console -n MyFistSwytchApp
cd MyFirstSwytchApp
Inside the
MyFirstSwytchApp
directory, you can optionally rename theProgram.cs
file toServer.cs
In Swytch, this will be the entry point of your application. This is just a convention for consistency, and you can name the file however you like. However throughout this documentation, this covention will be used and whenever you seeServer.cs
you should know that this is just the entry point of your application just like theProgram.cs
file you're used to.
Adding Nuget Package
You can easily add Swytch to your project using the Nuget package.
dotnet add package Swytch
or maybe a specific version with
dotnet add package Swytch --Version <number>
alternatively you can add the package reference to your project's .csproj
file
<PackageReference Include="Swytch" />