Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cask: a Scala HTTP micro-framework. Cask makes it easy to set up a website, backend server, or REST API using Scala

License

NotificationsYou must be signed in to change notification settings

com-lihaoyi/cask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

objectMinimalApplicationextends cask.MainRoutes{@cask.get("/")defhello()= {"Hello World!"  }@cask.post("/do-thing")defdoThing(request: cask.Request)= {    request.text().reverse  }  initialize()}

Cask is a simple Scala web framework inspired by Python'sFlask project. It aims to bring simplicity,flexibility and ease-of-use to Scala webservers, avoiding cryptic DSLs orcomplicated asynchrony. Cask makes it easy to set up a website, backend server,or REST API using Scala

If you use Cask and like it, you will probably enjoy the following book by the Author:

Hands-on Scala has uses Requests-Scala extensively throughout the book, and hasthe entirety ofChapter 14: Simple Web and API Servers dedicated tothe library.Hands-on Scala is a great way to level up your skills in Scalain general and Cask in particular.

Cask is profiled using theJProfiler Java Profiler,courtesy of EJ Technologies

Changelog

0.11.3

  • Update examples to build with Mill 1.x
  • Example zips are now hosted on Maven Central rather than Github Releases

0.9.7

  • Add a helper method to create a dedicated virtual thread scheduler.#164

0.9.6

0.9.5

  • Fix path traversal issue when serving static files#157
  • Fix form submissions with empty file fields throwing exceptions#150
  • Add CI testing for Java 17 and 21#156

0.9.4

  • Allow overlap between static routes and wildcards#134

0.9.3

  • Introduce@postJsonCached to allow reference to the original body payload in@postJson#123

0.9.2

  • Properly decode URL parameters when passed as path segments or query params#114

  • Preserve leading slash when resolving static paths#111

  • Addcask.QueryParams type to allow route methods to take arbitrary query parameters,addcask.RemainingPathSegments as replacement forsubpath = true#108#109#110

0.9.1

  • Updateorg.xerial:sqlite-jdbc library in examples to version3.41.2.1 to
    support Apple Silicon
  • @staticResources and@staticFiles decorators now automatically infercontent types based on file extension

0.9.0

  • Update uPickle to 3.0.0
  • Update Geny to 1.0.0
  • Update Scala 3 to 3.2.2
  • Update Scala.js to 1.13.0
  • Update SourceCode to 0.3.0
  • Update PPrint to 0.8.1
  • Update Castor to 0.3.0

0.8.3

  • Fix error reporting for invalid routes#70

0.8.2

  • Bump uPickle to 1.6.0

0.8.1

  • Publish Cask for Scala 2.12 again

0.8.0

  • Improve handling on 404/405 responses with unsupported methods(#52)

0.7.21

  • Fix example project zips

0.7.14

  • Update Castor to 0.1.8
  • Add@cask.options decorator

0.7.11

  • Build for Scala 3.0.0

0.7.10

  • Return 405 for unsupported HTTP methods
  • Upgrade Scala versions to 2.13.5 and 3.0.0-RC3

0.7.9

  • Add support for Scala 3.0.0-RC2

0.7.8

  • Upgrade undertow
  • Add support for Scala 3.0.0-M2

0.7.7

  • Fix published examples

0.7.6

  • Add support for Dotty (to be Scala 3)

0.7.4

  • Bump Mill version to 0.8.0

0.7.3

  • Make CaskactorContext explicitly passed into every Routes case class

0.6.5

  • Add support forgeny.Writable#httpContentType andgeny.Writable#contentLength

0.5.7

  • Add endpoints fordelete andpatch
  • Allow arbitrary HTTP methods

0.5.2

  • Bump uPickle, Requests versions

0.3.7

  • AddSameSite cookie attribute
  • Fix bug in default parameters of cask routes

0.3.6

0.3.3

  • Separatecask-actor into a separate artifact, documented separately asCask Actors

0.3.2

  • Support for Scala 2.13.2

0.3.1

  • Mismatched decorator types applied to a single method is now a compile error

  • staticFiles andstaticResources now allows you to specify response headers

  • Allowcask.decorators.compress to be used as acask.Routes orcask.Maindecorator without crashing on websocket responses

  • Allow decorators to be defined and used for non-cask.Response results

0.3.0

  • Fix crashes incask.WebsocketClientImpl

0.2.9

  • Provide a simple cross-platform builtin websocket client incask.WsClient

0.2.8

  • MakeRoutes#log implicit

0.2.7

  • Cross-publishcask.util for Scala.js

0.2.6

  • Embedconcurrent.ExecutionContext.global incask.Routes by default, to beoverriden if necessary

0.2.5

  • Internal refactoring to clean up routing logic

0.2.4

  • Standardize on a basiccask.Logger interface
  • Create a simple actor-based API for handling websockets incask.WsHandlerandcask.WsActor

0.2.3

  • cask.Response is now covariant

0.2.2

  • Use standard./mill bootstrap script

0.2.1

  • Support for Scala 2.13.0

About

Cask: a Scala HTTP micro-framework. Cask makes it easy to set up a website, backend server, or REST API using Scala

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors25

Languages


[8]ページ先頭

©2009-2025 Movatter.jp