• Stars
    star
    525
  • Rank 84,404 (Top 2 %)
  • Language
    Scala
  • License
    Other
  • Created over 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cask: a Scala HTTP micro-framework

Cask 0.9.1: a Scala HTTP micro-framework 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.9.1

  • Update org.xerial:sqlite-jdbc library in examples to version 3.41.2.1 to
    support Apple Silicon
  • @staticResources and @staticFiles decorators now automatically infer content 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 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

More Repositories

1

Ammonite

Scala Scripting
Scala
2,601
star
2

mill

Mill is a fast JVM build tool that supports Java and Scala. Mill aims to make your project’s build process performant, maintainable, and flexible
Scala
2,027
star
3

fastparse

Writing Fast Parsers Fast in Scala
Scala
1,091
star
4

scalatags

ScalaTags is a small XML/HTML construction library for Scala.
Scala
731
star
5

upickle

uPickle: a simple, fast, dependency-free JSON & Binary (MessagePack) serialization library for Scala
Scala
711
star
6

requests-scala

A Scala port of the popular Python Requests HTTP client: flexible, intuitive, and straightforward to use.
Scala
694
star
7

os-lib

OS-Lib is a simple, flexible, high-performance Scala interface to common OS filesystem and subprocess APIs
Scala
690
star
8

sourcecode

Scala library providing "source" metadata to your program, similar to Python's __name__, C++'s __LINE__ or Ruby's __FILE__.
Scala
521
star
9

utest

A simple testing framework for Scala
Scala
487
star
10

acyclic

Acyclic is a Scala compiler plugin to let you prohibit circular dependencies between files
Scala
247
star
11

fansi

Scala/Scala.js library for manipulating Fancy Ansi colored strings
Scala
224
star
12

PPrint

Pretty-printing value, types and type-signatures in Scala
Scala
217
star
13

scalasql

Scala ORM to query SQL databases from Scala via concise, type-safe, and familiar case classes and collection operations. Connects to Postgres, MySql, H2, and Sqlite out of the box
Scala
180
star
14

mainargs

A small, convenient, dependency-free library for command-line argument parsing in Scala
Scala
173
star
15

castor

Castor is a lightweight, typed Actor library for Scala and Scala.js
Scala
127
star
16

geny

Provides the geny.Generator data type, the dual to a scala.Iterator that can ensure resource cleanup
Scala
88
star
17

unroll

Scala
18
star
18

mill-scala-hello.g8

Giter8 template for a Mill project with a Scala Hello App
Shell
10
star
19

mill-moduledefs

Scalac compiler plugin to support Mill modules
Scala
6
star