This is an 8th Light Apprenticeship project, built in C# and .NET.
.NET is a free, cross-platform, open source developer platform for building many different types of applications.
C# is a simple, modern, object-oriented, and type-safe programming language.
- To download .NET Core, click here.
- This project uses .NET version
6.0.202
Run the command:
dotnet --version
to determine which version you have installed, or visit the .NET docs for more information.
- This project started off with a simple Echo Server, and has been built out into an HTTP Server.
- This HTTP server includes routes, requests, and responses.
- The routes must be customizable with a URL, a verb, and an action to take when the route is called.
A user should be able to interact with the HTTP server as follows:
- When a client sends a properly formatted request to the server, the server sends an appropriate response back to the client.
- A client can send different HTTP requests to the server and get the appropriate response back each time.
- Different clients can send messages to server and get back their proper responses.
- The server should be able to handle 200, 300, and 400-level responses.
- This server is capable of handling files, images (jpg, png, gif), XML, HTML, and JSON
- The server should establish a socket connection with the client using a low-level socket library.
- The server should accept and return streams of data rather than raw strings.
- The HTTP server should be covered by a robust suite of unit tests.
- The HTTP server should pass all of the tests covered in the acceptance test suite
dotnet run --project TKeazirian.HTTPServer
This project uses xUnit.net for testing.
This project also uses an acceptance test suite written using Cucumber.
dotnet test
- You will need Ruby version
2.5.1
. You can install Ruby using brew or the Ruby docs. - Once Ruby is installed, run
ruby -v
to confirm you are using the appropriate version. - Next, run
bundle install
.
Note: This server is currently programmed to run on port 5000
. If you would like to change the port, you can change the value of the variable, _port
in Server.cs and recompile. In the future, the goal is to make this customizable via a command-line argument.
- Start your HTTP server (you can do this with the run the app command or click
Run
if you are using an IDE) - Navigate into the http_server_spec folder:
cd TKeazirian.HTTPServer/http_server_spec
- You can run the acceptance tests with:
rake test
or
bundle exec spinach
Note: You can skip any of the acceptance tests by adding @wip
to the test(s).