• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Blue eyes
 

Blue eyes

on

  • 1,284 views

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.

Statistics

Views

Total Views
1,284
Views on SlideShare
1,284
Embed Views
0

Actions

Likes
1
Downloads
27
Comments
0

0 Embeds 0

No embeds

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

    Blue eyes Blue eyes Presentation Transcript

    • @_JamesWard jamesward.com Intro to BlueEyes
    • 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
        • github.com/jamesward/helloblueeyes
    • Run Locally
        • SBT Plugin for start script:
        • import com.typesafe.startscript.StartScriptPlugin
        • seq(StartScriptPlugin.startScriptForClassesSettings: _*)
        • $ sbt stage
        • $ target/start net.interdoodle.examples.AppServer
    • 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
    • Deploy on Heroku
        • $ git init
        • $ git add .
        • $ git commit -m init
        • $ heroku create -s cedar
        • $ git push heroku master
    • Heroku Cool Stuff
        • $ heroku scale web=5
        • $ heroku logs -t
        • $ heroku config
        • $ heroku releases
        • $ heroku addons
        • 750 Free Dyno Hours
        • per application, per month
        • java.herokuapp.com
    • 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
    • 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
    • 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
    • Running Locally
        • Option 1) Netty HttpStaticFileServer serves static files over HTTP
        • Option 2) Whatever HTTP server you want
        • HelloJsonServices = JSON + jQuery
        • HelloMongoServices = JSON + jQuery + MongoDB
      Examples
    • 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