tejaswita / dropwizard-rest-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dropwizard-rest-api

About the Example:

The sample code demonstrates simple REST API using dropwizard.

Stack

  1. Dropwizard
  2. Gradle
  3. Postgresql
  4. Heroku

It uses Gradle for build and has config for deploying onto Heroku. Its connects to Postgresql available as a Heroku add-on.

REST API

  1. NameResource - takes the path parameter from the GET request and returns the same.

GET /display/somevaluetodisplay HTTP/1.1 Host: localhost:8080 Content-Type: text/plain Cache-Control: no-cache

  1. resource.ColorCodeResourceTest - accepts POST request with username and password, searches postgresql db and returns authenticated user object as response.

POST /login HTTP/1.1 Host: localhost:8080 Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded

username=xyz&password=password

About


Languages

Language:Java 100.0%