{"id":19865638,"url":"https://github.com/openfaas/dotnet-templates","last_synced_at":"2025-10-06T13:49:55.437Z","repository":{"id":233560915,"uuid":"787451366","full_name":"openfaas/dotnet-templates","owner":"openfaas","description":"Templates for .NET","archived":false,"fork":false,"pushed_at":"2024-06-18T11:42:02.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T00:34:19.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfaas.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-16T14:46:25.000Z","updated_at":"2024-06-18T11:42:06.000Z","dependencies_parsed_at":"2024-04-16T18:30:48.352Z","dependency_job_id":"9e19fa42-942d-47cd-8492-9e9fce915ac4","html_url":"https://github.com/openfaas/dotnet-templates","commit_stats":null,"previous_names":["openfaas/dotnet-templates"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openfaas/dotnet-templates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fdotnet-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fdotnet-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fdotnet-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fdotnet-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfaas","download_url":"https://codeload.github.com/openfaas/dotnet-templates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fdotnet-templates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621837,"owners_count":26017253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-12T15:23:32.577Z","updated_at":"2025-10-06T13:49:55.421Z","avatar_url":"https://github.com/openfaas.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotnet-templates\n\nTemplates for .NET\n\n## dotnet8-csharp\n\nThis template uses the ASP.net minimal API style, and exposes a static function to register HTTP handlers. It is multi-arch, and supports Linux for amd64 and Arm64 via `faas-cli publish` or `faas-cli up --publish`.\n\nRegister a `/hello` as an endpoint:\n\n```csharp\n    public static void MapEndpoints(WebApplication app) {\n        app.MapGet(\"/hello\", () =\u003e \"Hello, world!\");\n    }\n\n```\n\nThe `RegisterServices` method can be used to configure any WebApplication services such as Swagger generators.\n\n```csharp\n    public static void MapServices(IServiceCollection services)\n    {\n        services.AddEndpointsApiExplorer();\n        services.AddSwaggerGen();\n    }\n```\n\nPull the template:\n\n```bash\nfaas-cli template pull https://github.com/openfaas/dotnet-templates\n```\n\nCreate a new function using the template:\n\n```bash\nexport PREFIX=\"ttl.sh\"\nfaas-cli new --lang dotnet8-csharp $PREFIX hello-world\n```\n\n## Adding static files\n\nIf a folder named static is found in the root of your function's source code, **it will be copied** into the final image published for your function.\n\nTo serve the contents of the static folder you can setup the file server in `Handler.cs`.\n\n```c#\n    public static void MapEndpoints(WebApplication app) {\n        app.UseStaticFiles();\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fdotnet-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfaas%2Fdotnet-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fdotnet-templates/lists"}