Git Product home page Git Product logo

dropwizard-scala-example's Introduction

Dropwizard Scala Example

Build Status

About

This is an example Dropwizard app using Scala.

  • Dropwizard 1.0.4

  • Scala-2.12.0

  • Java 8

  • Maven 3

  • Guice dependency injection

  • JSON and XML serialization using Java and Scala entities

  • Example resource , health check, filter.

Running The App

mvn clean package
java -jar target/dropwizard-scala-example.jar server src/main/resources/config.yml

Running The App In Docker

This assumes you have a working docker environment

Run the app inside docker
mvn clean package
docker build -t dropwizard-scala-example .
docker run dropwizard-scala-example
Run bash shell inside Docker (you know, to check some stuff)
docker run -i -t dropwizard-scala-example /bin/bash
Tip
make dist image run builds and runs docker image.

XML and JSON Serialization Examples

Example (serialize plain Java/Scala object to JSON)

curl -v http://127.0.0.1:8080/example/scala/json
curl -v http://127.0.0.1:8080/example/java/json

Example (serialize Java/Scala entity with JAXB annotation to XML)

curl -v http://127.0.0.1:8080/example/scala/xml
curl -v http://127.0.0.1:8080/example/java/xml

Example (serialize Java/Scala entity with JAXB annotation to either JSON or XML)

curl -v -H "Accept:application/json" http://127.0.0.1:8080/example/scala
curl -v -H "Accept:application/xml" http://127.0.0.1:8080/example/scala
curl -v -H "Accept:application/json" http://127.0.0.1:8080/example/java
curl -v -H "Accept:application/xml" http://127.0.0.1:8080/example/java

dropwizard-scala-example's People

Contributors

jecklgamis avatar

Watchers

Tyler Vann-Campbell 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.