/facebook-microservice

Example of (micro)service written in Scala & akka-http

Primary LanguageHTMLMIT LicenseMIT

Facebook service written for ScalaWaw #4 Hackathon

More details on Meetup page.

Join the chat at https://gitter.im/theiterators/akka-http-microservice

Deploy to Heroku

Caller usage

Get profile: GET /profile?fb_token=...

Get events: GET /events?fb_token=...&fb_profile=...&meetup_profile=...&city=...&date_from=...&date_to=...

Development Usage

Start services with sbt:

$ sbt
> ~re-start

With the service up, you can start sending HTTP requests:

$ curl http://localhost:9000/ip/8.8.8.8
{
  "city": "Mountain View",
  "ip": "8.8.8.8",
  "latitude": 37.386,
  "country": "United States",
  "longitude": -122.0838
}
$ curl -X POST -H 'Content-Type: application/json' http://localhost:9000/ip -d '{"ip1": "8.8.8.8", "ip2": "8.8.4.4"}'
{
  "distance": 2201.448386715217,
  "ip1Info": {
    "city": "Mountain View",
    "ip": "8.8.8.8",
    "latitude": 37.386,
    "country": "United States",
    "longitude": -122.0838
  },
  "ip2Info": {
    "ip": "8.8.4.4",
    "country": "United States",
    "latitude": 38.0,
    "longitude": -97.0
  }
}

Testing

Execute tests using test command:

$ sbt
> test

Author & license

Based on akka-http-microservice by:

Łukasz Sowa lukasz@theiterators.com from Iterators.

For licensing info see LICENSE file in project's root directory.