Blue eyes
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
Uploaded on

The author is managing editor of http://scalacourses.com, which offers self-paced online courses that teach Introductory and Intermediate Scala and Play Framework.

The author is managing editor of http://scalacourses.com, which offers self-paced online courses that teach Introductory and Intermediate Scala and Play Framework.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,459
On Slideshare
1,459
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
28
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. @_JamesWard jamesward.com Intro to BlueEyes
  • 2. What is BlueEyes?
      • Map HTTP requests to Scala handlers
        • Determine Scala handler via a pattern tree
        • Patterns to match on include HTTP verb, content type, URL path
        • Patterns become partial functions
      • Non-blocking end-to-end
      • Netty for HTTP
      • Versionable services
  • 3.
      • github.com/jamesward/helloblueeyes
  • 4. Run Locally
      • SBT Plugin for start script:
      • import com.typesafe.startscript.StartScriptPlugin
      • seq(StartScriptPlugin.startScriptForClassesSettings: _*)
      • $ sbt stage
      • $ target/start net.interdoodle.examples.AppServer
  • 5. Run on Heroku
      • Environment variable for port
      • trait EnvHttpServer extends HttpServer { self =>
      • override def main(args: Array[String]) {
      • // build a config string
      • val configString = "server.port = " +
      • Properties.envOrElse("PORT", "8080") + "n" +
      • "server.sslEnable = " +
      • Properties.envOrElse("SSL_ENABLE", "false")
      • Create a Procfile
      • web: target/start net.interdoodle.example.AppServer
  • 6. Deploy on Heroku
      • $ git init
      • $ git add .
      • $ git commit -m init
      • $ heroku create -s cedar
      • $ git push heroku master
  • 7. Heroku Cool Stuff
      • $ heroku scale web=5
      • $ heroku logs -t
      • $ heroku config
      • $ heroku releases
      • $ heroku addons
  • 8.
      • 750 Free Dyno Hours
      • per application, per month
  • 9.
      • java.herokuapp.com
  • 10. Really Scalable Webapps
      • Client/Server all over again (UI/Data)
      • Stateless web tier
      • All UI state on the client
      • Static UI assets can easily be edge cached
      • Data is really hard to decentralize
      • UI on a CDN
      • Data on a CAP
  • 11. Multiple Hosts = Multiple Domains
      • Static content on: http://cdn.foo.com
      • App on: http://www.foo.com
      • Ruh Roh... XHR can't do crossdomain!
      • Options:
        • JSONP
        • iframe hackery (not fun or clean)
        • Flash?
        • Browser x-origin opt-in... Someday.
        • Proxy server
        • Thin app wrapper
  • 12. Thin App Wrapper
      • Load www.foo.com from app server
      • www.foo.com loads all static content (JavaScript, Images, HTML, CSS) from cdn.foo.com
      • JavaScript running in the context of www.foo.com make data requests back to www.foo.com
  • 13. Running Locally
      • Option 1) Netty HttpStaticFileServer serves static files over HTTP
      • Option 2) Whatever HTTP server you want
  • 14.
      • HelloJsonServices = JSON + jQuery
      • HelloMongoServices = JSON + jQuery + MongoDB
    Examples
  • 15. App on Heroku
      • $ heroku create -s cedar
      • $ git push heroku master
    Static Content on AWS CloudFront
      • Copy src/main/webapp to S3 Bucket
      • Set permissions
      • Create CloudFront distribution