{"id":13704890,"url":"https://github.com/theiterators/akka-http-microservice","last_synced_at":"2025-05-05T12:32:32.286Z","repository":{"id":25720579,"uuid":"29157539","full_name":"theiterators/akka-http-microservice","owner":"theiterators","description":"Example of http (micro)service in Scala \u0026 akka-http","archived":false,"fork":false,"pushed_at":"2024-08-15T20:28:08.000Z","size":247,"stargazers_count":749,"open_issues_count":6,"forks_count":233,"subscribers_count":51,"default_branch":"master","last_synced_at":"2024-11-13T12:40:59.579Z","etag":null,"topics":["akka","akka-http","boilerplate","microservice","scala","skeleton","starter-kit","template"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theiterators.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-12T21:20:34.000Z","updated_at":"2024-10-25T10:42:34.000Z","dependencies_parsed_at":"2024-01-12T21:17:30.583Z","dependency_job_id":"081ee541-86ec-4ebe-8aa4-4aa7df703a02","html_url":"https://github.com/theiterators/akka-http-microservice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theiterators%2Fakka-http-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theiterators%2Fakka-http-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theiterators%2Fakka-http-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theiterators%2Fakka-http-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theiterators","download_url":"https://codeload.github.com/theiterators/akka-http-microservice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252497665,"owners_count":21757656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akka","akka-http","boilerplate","microservice","scala","skeleton","starter-kit","template"],"created_at":"2024-08-02T22:00:22.943Z","updated_at":"2025-05-05T12:32:31.918Z","avatar_url":"https://github.com/theiterators.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"# Akka HTTP microservice example\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/theiterators/akka-http-microservice/master/COPYING)\n![Build Status](https://github.com/theiterators/akka-http-microservice/actions/workflows/ci.yml/badge.svg)\n\n**Due to recent [Akka's license change](https://www.lightbend.com/blog/why-we-are-changing-the-license-for-akka), a fork named [Pekko](https://github.com/apache/incubator-pekko) was created under the Apache Foundation. Starting a new project, you should consider using [Pekko HTTP](https://github.com/apache/incubator-pekko-http). There's a sibling open source template we've created named [pekko-http-microservice](https://github.com/theiterators/pekko-http-microservice).**\n\nThis project demonstrates the [Akka HTTP](https://doc.akka.io/docs/akka-http/current/?language=scala) library and Scala to write a simple REST (micro)service. The project shows the following tasks that are typical for most Akka HTTP-based projects:\n\n* starting standalone HTTP server,\n* handling file-based configuration,\n* logging,\n* routing,\n* deconstructing requests,\n* unmarshalling JSON entities to Scala's case classes,\n* marshaling Scala's case classes to JSON responses,\n* error handling,\n* issuing requests to external services,\n* testing with mocking of external services.\n\nThe service in the template provides two REST endpoints - one which gives GeoIP info for given IP and another for calculating geographical distance between given pair of IPs. The project uses the service [ip-api](http://ip-api.com/) which offers JSON IP and GeoIP REST API for free for non-commercial use.\n\nIf you want to read a more thorough explanation, check out [tutorial](https://github.com/theiterators/akka-http-microservice/blob/master/TUTORIAL.md).\n\n[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)\n[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/theiterators/akka-http-microservice)\n## Usage\n\nStart services with sbt:\n\n```\n$ sbt\n\u003e ~reStart\n```\n\nWith the service up, you can start sending HTTP requests:\n\n```\n$ curl http://localhost:9000/ip/8.8.8.8\n{\n  \"city\": \"Mountain View\",\n  \"query\": \"8.8.8.8\",\n  \"country\": \"United States\",\n  \"lon\": -122.0881,\n  \"lat\": 37.3845\n}\n```\n\n```\n$ curl -X POST -H 'Content-Type: application/json' http://localhost:9000/ip -d '{\"ip1\": \"8.8.8.8\", \"ip2\": \"93.184.216.34\"}'\n{\n  \"distance\": 4347.624347494718,\n  \"ip1Info\": {\n    \"city\": \"Mountain View\",\n    \"query\": \"8.8.8.8\",\n    \"country\": \"United States\",\n    \"lon\": -122.0881,\n    \"lat\": 37.3845\n  },\n  \"ip2Info\": {\n    \"city\": \"Norwell\",\n    \"query\": \"93.184.216.34\",\n    \"country\": \"United States\",\n    \"lon\": -70.8228,\n    \"lat\": 42.1508\n  }\n}\n```\n\n### Testing\n\nExecute tests using `test` command:\n\n```\n$ sbt\n\u003e test\n```\n\n## Author \u0026 license\n\nIf you have any questions regarding this project, contact:\n\nŁukasz Sowa \u003clukasz@iteratorshq.com\u003e from [Iterators](https://www.iteratorshq.com).\n\nFor licensing info see LICENSE file in project's root directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheiterators%2Fakka-http-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheiterators%2Fakka-http-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheiterators%2Fakka-http-microservice/lists"}