{"id":26693970,"url":"https://github.com/slogsdon/cork","last_synced_at":"2025-03-26T18:28:02.409Z","repository":{"id":29428805,"uuid":"121660534","full_name":"slogsdon/cork","owner":"slogsdon","description":"F# port of Elixir's Plug library (IN PROGRESS)","archived":false,"fork":false,"pushed_at":"2023-03-01T05:33:03.000Z","size":499,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-12T08:56:47.765Z","etag":null,"topics":["aspnet-core","fable","fsharp","node-http"],"latest_commit_sha":null,"homepage":"","language":"F#","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/slogsdon.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":"2018-02-15T17:43:35.000Z","updated_at":"2023-03-12T08:56:47.765Z","dependencies_parsed_at":"2023-01-14T14:54:42.288Z","dependency_job_id":null,"html_url":"https://github.com/slogsdon/cork","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slogsdon%2Fcork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slogsdon%2Fcork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slogsdon%2Fcork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slogsdon%2Fcork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slogsdon","download_url":"https://codeload.github.com/slogsdon/cork/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245711630,"owners_count":20660113,"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","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":["aspnet-core","fable","fsharp","node-http"],"created_at":"2025-03-26T18:28:01.994Z","updated_at":"2025-03-26T18:28:02.395Z","avatar_url":"https://github.com/slogsdon.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cork\n\nF# port of [Elixir's Plug library](https://github.com/elixir-lang/plug)\n\n## Projects\n\n- [Cork](src/Cork)\n  - Core library\n  - Targets `netstandard1.6` to match F# (as of 15 Feb 2018)\n- [Cork.AspNetCore](src/Cork.AspNetCore)\n  - Library for using Cork in an ASP.NET Core project with included ASP.NET middleware and helpers to aid in project development\n  - Targets `netstandard2.0` to match Microsoft.AspNetCore (as of 15 Feb 2018)\n- [Cork.Fable.Http](src/Cork.Fable.Http)\n  - Library for using Cork in a Node.js project which uses the built-in HTTP server with included helpers to aid in project development\n  - Targets `netstandard2.0` to match Fable.Import.Node (as of 16 Feb 2018)\n\n## Installation\n\nAdd a Cork package to your project via `dotnet add package`, `paket add`, etc. For example:\n\n```\ndotnet add package Cork\n```\n\n## Getting Started\n\n```fsharp\nopen Cork\nopen Cork.Connection\n\n// new class type extending abstract\ntype MyCork () =\n  inherit BaseCork()\n\n  override __.Call _options conn =\n    conn\n    |\u003e resp 200 \"Hello world!\"\n    |\u003e Ok\n\nlet corks = [\n  cork MyCork defaultCorkOptions\n  cork TestCork defaultCorkOptions\n]\n\n// this should be updated with real connection information\nlet conn = Connection.defaultConnection\n\nconn |\u003e run corks\n```\n\n## Examples\n\nFor a full end-to-end demonstration, look at one of the below example projects:\n\n- [Cork.Example.AspNetCore](examples/Cork.Example.AspNetCore) - Minimal ASP.NET Core project using Cork, created with `dotnet new web -lang f#` and modified to use Cork.AspNetCore.\n- [Cork.Example.Fable.Http](examples/Cork.Example.Fable.Http) - Minimal Node.js project using Cork, created with `dotnet new fable-library -lang f#` and modified to use Cork.Fable.Http.\n\n## TODO\n\n- Convert Makefile to FAKE script\n- Expand ASP.NET middleware to use more than HttpContext API\n  - Create Connection helpers\n  - Map data between Connection and HttpContext\n- Test existing code\n- Finish documentation for existing code\n- Publish to Nuget?\n- Support Suave?\n- Enhance C# interop\n- Investigate if a computation expression would be beneficial to offer. Potentially:\n\n  ```fsharp\n  let corks =\n    cork_builder {\n      cork CorkName, options\n      cork AnotherCork\n    }\n  ```\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslogsdon%2Fcork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslogsdon%2Fcork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslogsdon%2Fcork/lists"}