Giter Club home page Giter Club logo

cask's Introduction

Cask: a Scala HTTP micro-framework Build Status Gitter Chat Patreon

object MinimalApplication extends cask.MainRoutes{
  @cask.get("/")
  def hello() = {
    "Hello World!"
  }

  @cask.post("/do-thing")
  def doThing(request: cask.Request) = {
    request.text().reverse
  }

  initialize()
}

Cask is a simple Scala web framework inspired by Python's Flask project. It aims to bring simplicity, flexibility and ease-of-use to Scala webservers, avoiding cryptic DSLs or complicated asynchrony.

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 has the entirety of Chapter 14: Simple Web and API Servers dedicated to the library. Hands-on Scala is a great way to level up your skills in Scala in general and Cask in particular.

Cask is profiled using the JProfiler Java Profiler, courtesy of EJ Technologies

Changelog

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 Cask actorContext explicitly passed into every Routes case class

0.6.5

  • Add support for geny.Writable#httpContentType and geny.Writable#contentLength

0.5.7

  • Add endpoints for delete and patch
  • Allow arbitrary HTTP methods

0.5.2

  • Bump uPickle, Requests versions

0.3.7

  • Add SameSite cookie attribute
  • Fix bug in default parameters of cask routes

0.3.6

0.3.3

  • Separate cask-actor into a separate artifact, documented separately as Cask 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 and staticResources now allows you to specify response headers

  • Allow cask.decorators.compress to be used as a cask.Routes or cask.Main decorator without crashing on websocket responses

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

0.3.0

  • Fix crashes in cask.WebsocketClientImpl

0.2.9

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

0.2.8

  • Make Routes#log implicit

0.2.7

  • Cross-publish cask.util for Scala.js

0.2.6

  • Embed concurrent.ExecutionContext.global in cask.Routes by default, to be overriden if necessary

0.2.5

  • Internal refactoring to clean up routing logic

0.2.4

  • Standardize on a basic cask.Logger interface
  • Create a simple actor-based API for handling websockets in cask.WsHandler and cask.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

cask's People

Contributors

anatoliykmetyuk avatar ckipp01 avatar jodersky avatar lihaoyi avatar lihaoyi-databricks avatar lolgab avatar manuelweiss avatar nicolasstucki avatar vincenzobaz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.