reactive rest on play2 & reactivemongo

16
REST Services with Play2 Scala & ReactiveMongo

Upload: raulraja

Post on 05-Dec-2014

1.520 views

Category:

Technology


2 download

DESCRIPTION

A quick tutorial focused on building a quick Reactive application with Play2 Framework that features a REST API backed by the asynchronous ReactiveMongo driver. Tutorial and sources available at https://github.com/47deg/bbcdzREST

TRANSCRIPT

Page 1: Reactive REST on Play2 & ReactiveMongo

REST Services with Play2 Scala & ReactiveMongo

Page 2: Reactive REST on Play2 & ReactiveMongo

Who am [email protected], Java, Objective-C

Page 3: Reactive REST on Play2 & ReactiveMongo

MAIN TOOLS TO BUILD THIS APP

Page 4: Reactive REST on Play2 & ReactiveMongo

App frameworks are like hipsters, always looking for the next cool thing.

There is a new kid on the block...REACTIVE APPS

Only one thing is better than reactive apps.

Monkey beard JORGE!

Page 5: Reactive REST on Play2 & ReactiveMongo

Let’s get started

Page 6: Reactive REST on Play2 & ReactiveMongo

Create the APP

Page 7: Reactive REST on Play2 & ReactiveMongo

Run it!

Page 8: Reactive REST on Play2 & ReactiveMongo
Page 9: Reactive REST on Play2 & ReactiveMongo

Play uses conf/routes to map http requests to controller actions

Page 10: Reactive REST on Play2 & ReactiveMongo

Play projects are SBT projects, here we add the dependencies

Page 11: Reactive REST on Play2 & ReactiveMongo

Play plugins are registered in conf/play.plugins

Page 12: Reactive REST on Play2 & ReactiveMongo

In conf/application.conf we add things like DB settings

Page 13: Reactive REST on Play2 & ReactiveMongo

In DEV mode you can see the configured routes on a bogus URL

Page 14: Reactive REST on Play2 & ReactiveMongo

Controllers implement the actions

Page 15: Reactive REST on Play2 & ReactiveMongo

Let’s build it!

If you did not attend the session a full tutorial is here

https://github.com/47deg/bbcdzREST

Page 16: Reactive REST on Play2 & ReactiveMongo

Become a Scala Master

For comprehensionsCase Classes

FuturesOptionsTraitsEither

Pattern MatchingMonadsActorsDSL’s

...