Scalatra is a lightweight, high-performance micro web framework written in Scala, inspired by the Ruby framework Sinatra. Its goal is to provide a minimal but expressive foundation for building web applications or REST APIs in Scala without the verbosity or steep learning curve of larger frameworks. It supports asynchronous request handling, routing, filters, content negotiation, and easy integration with templating, JSON libraries, and other web middleware. Being unopinionated, it lets developers pick their persistence, dependency injection, or templating layers, rather than enforcing heavy conventions. Scalatra is well-suited for services, APIs, or small–to–medium web applications where you want fine control over latency and structure, and it benefits from Scala’s type system and ecosystem.
Features
- Support for simple routing DSL: get, post, put, delete etc with parameter extraction in path or query string
- Integration with templating engines (views), JSON support etc for building full web apps or APIs
- Asynchronous request handling and non-blocking IO (for high throughput and responsive behavior)
- Compatibility with JVM ecosystem: works with Java servlet containers or embedded servers, integrates with SBT, etc.
- Modular and extendable with filters, middleware-style hooks, and flexible configuration
- Small core overhead; minimal boilerplate for setting up routes / handlers