The console application from chapter 2 receives command-line parameters and writes the specified string in ASCII art to the console output. The command-line library parses the parameters using common conventions, making the application easy to execute from a terminal. Creating a web service that performs the same function is just as easy.
In this section, we’ll port the ASCII art program into a web service using ASP.NET Core. In chapter 2, we used the dotnet new console command to create a console application from a template. Many other templates are available. You can see a list by running dotnet new list (or, in .NET 7 or earlier, dotnet new --list). We will use the empty web template for the ASCII art service. Use the command shown in the following listing to create a new folder with the new project.