https://github.com/guizmaii/playscala-compiletimedi-jsonhttperrorhandler
Play Scala (with compile time DI) JsonHttpErrorHandler example project
https://github.com/guizmaii/playscala-compiletimedi-jsonhttperrorhandler
compile-time dependency-injection json playframework rest-api scala
Last synced: about 2 months ago
JSON representation
Play Scala (with compile time DI) JsonHttpErrorHandler example project
- Host: GitHub
- URL: https://github.com/guizmaii/playscala-compiletimedi-jsonhttperrorhandler
- Owner: guizmaii
- Created: 2018-04-28T13:38:14.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-26T10:14:45.000Z (over 7 years ago)
- Last Synced: 2025-04-07T15:54:41.007Z (about 1 year ago)
- Topics: compile-time, dependency-injection, json, playframework, rest-api, scala
- Language: Scala
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PlayScala-CompileTimeDI-JsonHttpErrorHandler
Play Scala (with compile time DI) `JsonHttpErrorHandler` example project.
## Instructions to test the new `JsonHttpErrorHandler`
1. Publish a local version of Play
1.1 `$ git clone https://github.com/guizmaii/playframework`
1.2 `$ cd playframework`
1.3 `$ git checkout json_default_http_error_handler`
1.4 `$ sbt clean publishLocal`
2. (If necessary) Change the version of Play in `project/plugins.sbt` with the previously locally published one.
3. `$ sbt run`
4. Test with diffent calls
4.1 (HTTP 200) `$ curl -v http://localhost:9000/ | python -m json.tool`
4.2 (HTTP 404) `$ curl -v http://localhost:9000/routeThatDoesNotExist | python -m json.tool`
4.3 (HTTP 500) `$ curl -v http://localhost:9000/exception | python -m json.tool`
(The `| python -m json.tool` part of the command is here to pretty print JSON answers. Comes from here: https://stackoverflow.com/a/1920585)