All Projects → lloydmeta → slim-play

lloydmeta / slim-play

Licence: MIT License
Slim Play app

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to slim-play

play-docker-aws-tutorial
101 tutorial: How to deploy Play application to Amazon Lightsail (AWS) using Docker
Stars: ✭ 25 (-67.11%)
Mutual labels:  play-framework, play
Kebs
Scala library to eliminate boilerplate
Stars: ✭ 113 (+48.68%)
Mutual labels:  play-framework, play
Play26 Swagger Reactivemongo
A fully featured CRUD app built with Play 2.6, Swagger and ReactiveMongo
Stars: ✭ 36 (-52.63%)
Mutual labels:  play-framework, play
play-ebean
Play Ebean module
Stars: ✭ 29 (-61.84%)
Mutual labels:  play-framework, play
msLog
log for webView & webApp 用于webView和webApp的log工具
Stars: ✭ 25 (-67.11%)
Mutual labels:  webapp
nthu-route
VLSI EDA Global Router
Stars: ✭ 35 (-53.95%)
Mutual labels:  router
ParkCatcher
Find a free parking in the nearest residential street when driving in Montréal. A Montréal Open Data project.
Stars: ✭ 32 (-57.89%)
Mutual labels:  webapp
okwolo
light javascript framework to build web applications
Stars: ✭ 19 (-75%)
Mutual labels:  router
GitHubSearch
GitHub iOS client with minimum third-party dependencies.
Stars: ✭ 34 (-55.26%)
Mutual labels:  router
fritz-box
📦 Promise-based JavaScript FRITZ!Box API.
Stars: ✭ 14 (-81.58%)
Mutual labels:  router
flow-spring-examples
Examples for Vaadin and Spring Boot
Stars: ✭ 39 (-48.68%)
Mutual labels:  webapp
navigation-skeleton
This component allows you to show skeletons of pages during navigation process.
Stars: ✭ 16 (-78.95%)
Mutual labels:  router
go router
The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
Stars: ✭ 380 (+400%)
Mutual labels:  router
fao
Party game based on Oink Games' tabletop game, "A Fake Artist Goes to New York." Draw with your phone or a mouse.
Stars: ✭ 70 (-7.89%)
Mutual labels:  webapp
koa-routeify
the next router for koajs.
Stars: ✭ 12 (-84.21%)
Mutual labels:  router
smoothr
A custom React router that leverages the Web Animations API and CSS animations.
Stars: ✭ 28 (-63.16%)
Mutual labels:  router
xRoute
一个小型的前端路由库✈️
Stars: ✭ 36 (-52.63%)
Mutual labels:  router
ulboracms
Ulbora CMS is a self-contained CMS (no database needed) written in Golang. It uses a JSON datastore with content saved in both json files and in memory. You can download and upload a single binary backup file containing content, images, and templates as needed. It also has a built-in mail sender.
Stars: ✭ 42 (-44.74%)
Mutual labels:  webapp
cra-redux-boilerplate
⚛️🔨create-react-app application with redux and another cool libraries to make your life easier.
Stars: ✭ 15 (-80.26%)
Mutual labels:  router
play-java-ebean-example
Example Play application showing Java with Ebean
Stars: ✭ 54 (-28.95%)
Mutual labels:  webapp

Slim Play App Build Status

Wanna build a really, really slim Play project?

This project demonstrates how you can easily build a non-blocking, threadsafe, and fast Play app without having to use the default routes file. The end-result should be familiar territory for people who are used to the simplicity of Sinatra/Bottle but want to take advantage of Scala's concurrent, type-safe and scalable nature.

Templates

In case you want to get up and running right away, use the following Slim-Play templates:

For Giter8: $ g8 lloydmeta/slim-play

How to run

  1. Git clone this project or use a template
  2. sbt run from the project's root directory
  3. Open a browser and hit:

How it was built

All I did was:

  1. Use sbt new to generate a new Play app ($ sbt new playframework/play-scala-seed.g8 --name=slim-play)
  2. Delete the auto-generated controller, public, and view directories (won't be using them)
  3. Create a AppLoader.scala file in the ./app directory, which holds an ApplicationLoader and the router, which is super simple:
val router = Router.from {
  case GET(p"/hello/$to") => Action {
    Ok(s"Hello $to")
  }
  /*
   Use Action.async to return a Future result (sqrt can be intense :P)
   Note the use of double(num) to bind only numbers (built-in :)
   */
  case GET(p"/sqrt/${double(num)}") => Action.async {
    Future {
      Ok(Math.sqrt(num).toString)
    }
  }
}
  1. Add play.application.loader=AppLoader to ./conf/application.conf so that Play knows to load our custom app (that contains our simple router)

More info

The following links may be useful for further understanding on what is happening here:

  1. Official Play docs on String Interpolating Routing DSL
  2. Official Play docs on Compile-time dependency injection
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].