{"id":30432796,"url":"https://github.com/dbidwell94/csharpsimpleserver","last_synced_at":"2026-05-03T20:39:18.552Z","repository":{"id":55411136,"uuid":"315898495","full_name":"dbidwell94/CSharpSimpleServer","owner":"dbidwell94","description":"A simple HTTP Server for C# .NET Core. Very much a work in progress, and modeled closely after Java Spring backend. Fires up quickly and is very responsive. Not for enterprise applications, but for client side server applications (I.E. a home media server)","archived":false,"fork":false,"pushed_at":"2021-01-05T03:08:16.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-22T22:22:25.447Z","etag":null,"topics":["backend","dotnet-core","json","rest","server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbidwell94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-25T10:02:52.000Z","updated_at":"2021-01-02T01:16:06.000Z","dependencies_parsed_at":"2022-08-14T23:50:12.295Z","dependency_job_id":null,"html_url":"https://github.com/dbidwell94/CSharpSimpleServer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dbidwell94/CSharpSimpleServer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2FCSharpSimpleServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2FCSharpSimpleServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2FCSharpSimpleServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2FCSharpSimpleServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbidwell94","download_url":"https://codeload.github.com/dbidwell94/CSharpSimpleServer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbidwell94%2FCSharpSimpleServer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32584644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","dotnet-core","json","rest","server"],"created_at":"2025-08-22T21:32:59.793Z","updated_at":"2026-05-03T20:39:18.535Z","avatar_url":"https://github.com/dbidwell94.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSharpSimpleServer\nA simple HTTP Server for C# .NET Core. Very much a work in progress, and modeled closely after Java Spring backend. Fires up quickly and is very responsive. Not for enterprise applications, but for client side server applications (I.E. Plex)\n\n## Usage\nThe basic usage of this program is as such:\n\n```csharp\nusing System;\nusing SimpleServer;\nusing System.Threading;\n\nnamespace TestImplementation\n{\n    static class Program\n    {\n        static void Main(string[] args)\n        {\n            // This will find all RestControllers\n            Server.RegisterEndpoints();\n            // This will start the server on a seperate thread on port 2019\n            Server.Start(2019);\n            // Below are the current server events that you can subscribe to.\n            Server.onRequestReceived += LogMessage;\n            Server.onServerStart += LogMessage;\n            Server.onServerStop += LogMessage;\n            Server.onEndpointRegistrationFinished += LogMessage;\n            Server.onServerError += LogMessage;\n        }\n\n        private static void LogMessage(ServerEventData eventData)\n        {\n            string message = \"\";\n            if (eventData.exception != null)\n            {\n                Console.WriteLine(eventData.exception.StackTrace);\n                Console.WriteLine(eventData.exception.Message);\n                Console.WriteLine(eventData.exception.TargetSite);\n            }\n            if (eventData.path != null)\n            {\n                message += $\"{eventData.path.ToString()}\";\n            }\n            if (eventData.status != null)\n            {\n                message += $\" {eventData.status.ToString()}\";\n            }\n            if (eventData.message != null)\n            {\n                message += $\" -- {eventData.message}\";\n            }\n            Console.WriteLine(message);\n        }\n    }\n}\n\n```\n\n## So.. how do I define my endpoints?\nThat's easy: like this...\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing SimpleServer.Attributes;\nusing SimpleServer.Networking.Data;\n\nnamespace TestImplementation.Controllers\n{\n    // Currently, the path here does nothing. [RestController] just tells SimpleServer that this class contains endpoints\n    [RestController(\"/\")]\n    class TestController\n    {\n        [GetMapping(\"/\", Produces = MediaTypes.ApplicationJson, Accepts = MediaTypes.ApplicationJson)]\n        public ResponseEntity TestMessage()\n        {\n            return new ResponseEntity(\"test\");\n        }\n\n        // Notice the :videoName in the path? That is how you define a path parameter\n        [GetMapping(\"/video/:videoName\", Produces = MediaTypes.ApplicationJson, Accepts = MediaTypes.ApplicationJson)]\n        // Path parameters must be defined marked with a [PathParam] attribute and named exactly how you named it in the path\n        public ResponseEntity PathParameterTest([PathParam] string videoName)\n        {\n            Dictionary\u003cstring, object\u003e toReturn = new Dictionary\u003cstring, object\u003e();\n            toReturn.Add(\"videoName\", videoName);\n            return new ResponseEntity(toReturn);\n        }\n    }\n}\n```\n\n## How does it work?\n\nResponses in SimpleServer are handled with the ResponseEntity class. The ResponseEntity will serialize the data as JSON and send it\nas bytes to whatever requested the data. The JSON Serializer that SimpleServer uses is from [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbidwell94%2Fcsharpsimpleserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbidwell94%2Fcsharpsimpleserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbidwell94%2Fcsharpsimpleserver/lists"}