Building Web Apps in Ratpack
Upcoming SlideShare
Loading in...5
×
 

Building Web Apps in Ratpack

on

  • 1,486 views

see description

see description

Statistics

Views

Total Views
1,486
Views on SlideShare
1,480
Embed Views
6

Actions

Likes
0
Downloads
11
Comments
0

1 Embed 6

https://twitter.com 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Micro-services: So-called “Thin Server Architecture” High-throughput: 22,000 messages per second (http://netty.io/testimonials)
  • demo1/demo1.groovyview headers: curl -I http://localhost:5050post: curl -X POST http://localhost:5050/apiview static: http://localhost:5050/dan.htmlview headers of static content: curl -I http://localhost:5050/dan.html
  • demo2/demo2.groovyput: curl -X PUT http://localhost:5050/apipost: curl -X PUT http://localhost:5050/api
  • demo3/demo3.groovyContent negotiation is driven by the “Accept” headerget: curl -H “Accept: application/json” http://localhost:5050
  • demo4“gradle run” to run the app- IntelliJ support for Ratpack
  • demo4“gradle run” to run the app- IntelliJ support for Ratpack
  • demo4“gradle run” to run the app- IntelliJ support for Ratpack
  • demo5
  • demo5
  • demo5
  • demo6http://localhost:5050/http://localhost:5050/?name=Dan
  • demo6http://localhost:5050/eventhttp://localhost:5050/event/Dan
  • demo7http://localhost:5050/groovymn.png
  • demo7Run from the command line: build/install/demo7/bin/demo7
  • demo7Packaged app with runnable script: build/distributions/demo7.zip
  • demo7
  • demo7
  • demo7
  • demo7
  • demo7
  • demo7
  • demo7
  • demo7
  • … at a future meetuphttp://twitter.com/beckje01

Building Web Apps in Ratpack Building Web Apps in Ratpack Presentation Transcript

  • Building Web Apps in Ratpack Daniel Woods October 2013
  • About Me @danveloper #editor /danveloper daniel.p.woods
  • Welcome to Ratpack • Inspired by Ruby’s Sinatra Framework • Built on Netty • Written in Java, Optimized for Groovy • Also, Java 7 & Java 8 • Totally unopinionated framework • Optional Google Guice integration • Optional Gradle integration • Rapid development with SpringLoaded View slide
  • When to use Ratpack? • Micro-services • Supporting Single-Page Applications • High-throughput apps • Lightweight apps • No Container! • Cloud Deployments • Simple packaging strategy • Mock Services in Test? View slide
  • Quick Intro to Ratpack • Runnable from a Groovy script!
  • Quick Intro to Ratpack • Simple Groovy DSL for Handler chain
  • Quick Intro to Ratpack • Support for prefixed endpoints
  • Quick Intro to Ratpack • Handling content-type
  • More Complex Needs… • Gradle
  • More Complex Needs… • Dependency Injection
  • More Complex Needs… • Modules
  • Getting all Dynamic… • Templates
  • Getting all Dynamic… • Templates
  • Getting all Dynamic… • Handlebars Template Support!
  • Accessing Parameters • request.queryParams
  • Accessing Parameters • context.pathTokens
  • Modularizing Handlers • MongoDBAssetHandler example
  • Building Ratpack • gradle installApp
  • Packaging Ratpack • gradle distZip
  • Deploying Ratpack • Heroku • Step 0 – Add the Gradle Wrapper to your Project
  • Deploying Ratpack • Heroku • Step 0.1 – Add a settings.gradle file to your Project • Setting the rootProject.name = ‘demo’ will allow the buildpack to work properly.
  • Deploying Ratpack • Heroku • Step 1 – Authenticate on Terminal
  • Deploying Ratpack • Heroku • Step 2 – Create your app with Heroku
  • Deploying Ratpack • Heroku • Step 3 – Configure the buildpack
  • Deploying Ratpack • Heroku • Step 4.0 – git init (if you haven’t already) • Step 4.1 – add Heroku app’s remote git endpoint • Step 4.2 – git push -u heroku master
  • Deploying Ratpack • Heroku • Step 5 – Visit App
  • Deploying Ratpack • Heroku • Step 5 – Visit App
  • Testing Ratpack Apps Jeff Beck @beckje01
  • Ratpack Resources • The Ratpack Manual • http://www.ratpack-framework.org/manual/current/ • Ratpack GitHub (Samples, etc) • https://github.com/ratpack • Continuous Integration • http://drone.io • ??? (tweet me!) • Tomas Lin, Cloud Foundry deployment • http://fbflex.wordpress.com/2013/08/07/ratpack-to-cloudfoundry-with-java-buildpack/
  • The End