GithubHelp home page GithubHelp logo

nancymi / applied-scala Goto Github PK

View Code? Open in Web Editor NEW

This project forked from realestate-com-au/applied-scala

0.0 0.0 0.0 127 KB

A series of exercises to apply your Scala knowledge

License: MIT License

Shell 21.76% Scala 78.24%

applied-scala's Introduction

applied-scala

Build Status

Getting Started

Similar to Intro to Scala

  1. Skip this step if you have already done Intro to Scala on your current machine. If you're going to use IntelliJ IDEA (Community edition is fine), you need to install Java 8 even if you have a newer version of Java installed.
brew tap homebrew/cask-versions
brew cask install homebrew/cask-versions/adoptopenjdk8
  1. Before the course, please run the following:
git clone [email protected]:realestate-com-au/applied-scala.git
cd applied-scala
./auto/test
./auto/start-local

This should start the app. Note that the tests should be failing at this point.

  1. Now test this out in a new tab.
curl http://localhost:9200/movies

You should get back [{"name":"Titanic"}]. Now press ctrl+c in the previous tab to shut down the app.

  1. Open up the project in IntelliJ IDEA and make sure it all compiles. Now you're ready to go!

Open up SBT

Using Docker

./auto/sbt

or

Using portable SBT

./sbt

Run test

./auto/test

How to start app

./auto/start-local

Suggested Format

Day 1

Day 2

Further reading

Test queries

Fetch all movies

$ curl http://localhost:9200/movies

Fetch movie

$ curl http://localhost:9200/movies/1

Fetch enriched movie

$ curl http://localhost:9200/movies/1?enriched=true

Save movie

  1. Successful save
$ curl -H "Accept: application/json" -X POST -d "{\"name\": \"Cars 3\", \"synopsis\": \"Great movie about cars\"}" http://localhost:9200/movies
  1. Validation errors
$ curl -H "Accept: application/json" -X POST -d "{\"name\": \"\", \"synopsis\": \"\"}" http://localhost:9200/movies

Save review

  1. Successful save
$ curl -H "Accept: application/json"  -X POST -d "{\"author\": \"Jack\", \"comment\": \"Great movie huh\"}" http://localhost:9200/movies/1/reviews
  1. Validation errors
$ curl -H "Accept: application/json"  -X POST -d "{\"author\": \"\", \"comment\": \"\"}" http://localhost:9200/movies/1/reviews

applied-scala's People

Contributors

wjlow avatar millyrowboat avatar ssanj avatar lukestephenson avatar shaun-whitely avatar lukestephenson-zendesk avatar nicholasnbg avatar stilianouly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.