{"id":13801138,"url":"https://github.com/com-lihaoyi/cask","last_synced_at":"2025-05-15T03:07:23.625Z","repository":{"id":37669693,"uuid":"141645094","full_name":"com-lihaoyi/cask","owner":"com-lihaoyi","description":"Cask: a Scala HTTP micro-framework. Cask makes it easy to set up a website, backend server, or REST API using Scala","archived":false,"fork":false,"pushed_at":"2025-02-02T12:24:31.000Z","size":922,"stargazers_count":556,"open_issues_count":10,"forks_count":64,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-14T05:55:02.295Z","etag":null,"topics":["http","scala","server","web"],"latest_commit_sha":null,"homepage":"https://com-lihaoyi.github.io/cask/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/com-lihaoyi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"lihaoyi"}},"created_at":"2018-07-20T00:48:20.000Z","updated_at":"2025-04-10T07:17:34.000Z","dependencies_parsed_at":"2023-12-16T23:55:40.640Z","dependency_job_id":"0d9eddc0-77ff-40eb-8a30-f89553d8f301","html_url":"https://github.com/com-lihaoyi/cask","commit_stats":{"total_commits":327,"total_committers":21,"mean_commits":"15.571428571428571","dds":"0.19571865443425074","last_synced_commit":"8b598f7cb0e11b4cce46884c6adf333477a16368"},"previous_names":["lihaoyi/cask"],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/com-lihaoyi%2Fcask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/com-lihaoyi%2Fcask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/com-lihaoyi%2Fcask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/com-lihaoyi%2Fcask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/com-lihaoyi","download_url":"https://codeload.github.com/com-lihaoyi/cask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264766,"owners_count":22041793,"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":["http","scala","server","web"],"created_at":"2024-08-04T00:01:19.920Z","updated_at":"2025-05-15T03:07:18.586Z","avatar_url":"https://github.com/com-lihaoyi.png","language":"Scala","funding_links":["https://github.com/sponsors/lihaoyi","https://www.patreon.com/lihaoyi"],"categories":["Table of Contents","开发框架"],"sub_categories":["Web Frameworks"],"readme":"Cask 0.9.7: a Scala HTTP micro-framework [![Gitter Chat][gitter-badge]][gitter-link] [![Patreon][patreon-badge]][patreon-link]\n===========================================================================================================================================================================\n\n[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg\n[gitter-link]: https://gitter.im/lihaoyi/cask?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n[patreon-badge]: https://img.shields.io/badge/patreon-sponsor-ff69b4.svg\n[patreon-link]: https://www.patreon.com/lihaoyi\n\n```scala\nobject MinimalApplication extends cask.MainRoutes{\n  @cask.get(\"/\")\n  def hello() = {\n    \"Hello World!\"\n  }\n\n  @cask.post(\"/do-thing\")\n  def doThing(request: cask.Request) = {\n    request.text().reverse\n  }\n\n  initialize()\n}\n```\n\nCask is a simple Scala web framework inspired by Python's\n[Flask](http://flask.pocoo.org/docs/1.0/) project. It aims to bring simplicity,\nflexibility and ease-of-use to Scala webservers, avoiding cryptic DSLs or\ncomplicated asynchrony. Cask makes it easy to set up a website, backend server, \nor REST API using Scala\n\n- [Documentation](https://com-lihaoyi.github.io/cask/)\n\nIf you use Cask and like it, you will probably enjoy the following book by the Author:\n\n- [*Hands-on Scala Programming*](https://www.handsonscala.com/)\n\n*Hands-on Scala* has uses Requests-Scala extensively throughout the book, and has\nthe entirety of *Chapter 14: Simple Web and API Servers* dedicated to\nthe library. *Hands-on Scala* is a great way to level up your skills in Scala\nin general and Cask in particular.\n\nCask is profiled using the\n[JProfiler Java Profiler](https://www.ej-technologies.com/products/jprofiler/overview.html),\ncourtesy of EJ Technologies\n\n## Changelog\n\n### 0.9.7\n\n- Add a helper method to create a dedicated virtual thread scheduler. [#164](https://github.com/com-lihaoyi/cask/pull/164)\n\n### 0.9.6\n\n- Support for Java21/Loom Virtual Threads [#161](https://github.com/com-lihaoyi/cask/pull/159), see\n  [Running Cask with Virtual Threads](https://com-lihaoyi.github.io/cask/#running-cask-with-virtual-threads)\n\n### 0.9.5\n\n- Fix path traversal issue when serving static files [#157](https://github.com/com-lihaoyi/cask/pull/157)\n- Fix form submissions with empty file fields throwing exceptions [#150](https://github.com/com-lihaoyi/cask/pull/150)\n- Add CI testing for Java 17 and 21 [#156](https://github.com/com-lihaoyi/cask/pull/156)\n\n### 0.9.4\n\n- Allow overlap between static routes and wildcards [#134](https://github.com/com-lihaoyi/cask/pull/134)\n\n### 0.9.3\n\n- Introduce `@postJsonCached` to allow reference to the original body payload in `@postJson`\n  [#123](https://github.com/com-lihaoyi/cask/pull/123)\n\n### 0.9.2\n\n- Properly decode URL parameters when passed as path segments or query params [#114](https://github.com/com-lihaoyi/cask/pull/114)\n\n- Preserve leading slash when resolving static paths [#111](https://github.com/com-lihaoyi/cask/pull/111)\n\n- Add `cask.QueryParams` type to allow route methods to take arbitrary query parameters,\n  add `cask.RemainingPathSegments` as replacement for `subpath = true`\n  [#108](https://github.com/com-lihaoyi/cask/pull/108)\n  [#109](https://github.com/com-lihaoyi/cask/pull/109)\n  [#110](https://github.com/com-lihaoyi/cask/pull/110)\n\n### 0.9.1\n\n- Update `org.xerial:sqlite-jdbc` library in examples to version `3.41.2.1` to  \n  support Apple Silicon\n- `@staticResources` and `@staticFiles` decorators now automatically infer \n  content types based on file extension\n\n### 0.9.0\n\n- Update uPickle to 3.0.0\n- Update Geny to 1.0.0\n- Update Scala 3 to 3.2.2\n- Update Scala.js to 1.13.0\n- Update SourceCode to 0.3.0\n- Update PPrint to 0.8.1\n- Update Castor to 0.3.0\n\n### 0.8.3\n\n- Fix error reporting for invalid routes [#70](https://github.com/com-lihaoyi/cask/pull/70)\n\n### 0.8.2\n\n- Bump uPickle to 1.6.0\n\n### 0.8.1\n\n- Publish Cask for Scala 2.12 again\n\n### 0.8.0\n\n- Improve handling on 404/405 responses with unsupported methods\n  ([#52](https://github.com/com-lihaoyi/cask/pull/52))\n\n### 0.7.21\n\n- Fix example project zips\n\n### 0.7.14\n\n- Update Castor to 0.1.8\n- Add `@cask.options` decorator\n\n### 0.7.11\n\n- Build for Scala 3.0.0\n\n### 0.7.10\n\n- Return 405 for unsupported HTTP methods\n- Upgrade Scala versions to 2.13.5 and 3.0.0-RC3\n\n### 0.7.9\n\n- Add support for Scala 3.0.0-RC2\n\n### 0.7.8\n\n- Upgrade undertow\n- Add support for Scala 3.0.0-M2\n\n### 0.7.7\n\n- Fix published examples\n\n### 0.7.6\n\n- Add support for Dotty (to be Scala 3)\n\n### 0.7.4\n\n- Bump Mill version to 0.8.0\n\n### 0.7.3\n\n- Make Cask `actorContext` explicitly passed into every Routes case class\n\n### 0.6.5\n\n- Add support for `geny.Writable#httpContentType` and\n  `geny.Writable#contentLength`\n\n### 0.5.7\n\n- Add endpoints for `delete` and `patch`\n- Allow arbitrary HTTP methods\n\n### 0.5.2\n\n- Bump uPickle, Requests versions\n\n### 0.3.7\n\n- Add `SameSite` cookie attribute\n- Fix bug in default parameters of cask routes\n\n### 0.3.6\n\n- Extract `cask-actor` into its own repo and artifact,\n  [https://github.com/lihaoyi/castor](https://github.com/lihaoyi/castor)\n\n### 0.3.3\n\n- Separate `cask-actor` into a separate artifact, documented separately as\n  [Cask Actors](http://www.lihaoyi.com/cask/page/cask-actors.html)\n\n### 0.3.2\n\n- Support for Scala 2.13.2\n\n### 0.3.1\n\n- Mismatched decorator types applied to a single method is now a compile error\n\n- `staticFiles` and `staticResources` now allows you to specify response headers\n\n- Allow `cask.decorators.compress` to be used as a `cask.Routes` or `cask.Main`\n  decorator without crashing on websocket responses\n\n- Allow decorators to be defined and used for non-`cask.Response` results\n\n### 0.3.0\n\n- Fix crashes in `cask.WebsocketClientImpl`\n\n### 0.2.9\n\n- Provide a simple cross-platform builtin websocket client in `cask.WsClient`\n\n### 0.2.8\n\n- Make `Routes#log` implicit\n\n### 0.2.7\n\n- Cross-publish `cask.util` for Scala.js\n\n### 0.2.6\n\n- Embed `concurrent.ExecutionContext.global` in `cask.Routes` by default, to be\n  overriden if necessary\n\n### 0.2.5\n\n- Internal refactoring to clean up routing logic\n\n### 0.2.4\n\n- Standardize on a basic `cask.Logger` interface\n- Create a simple actor-based API for handling websockets in `cask.WsHandler`\n  and `cask.WsActor`\n\n### 0.2.3\n\n- `cask.Response` is now covariant\n\n### 0.2.2\n\n- Use standard `./mill` bootstrap script\n\n### 0.2.1\n\n- Support for Scala 2.13.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcom-lihaoyi%2Fcask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcom-lihaoyi%2Fcask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcom-lihaoyi%2Fcask/lists"}