Skip to content

Latest commit

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

SimpleChat

Stack Overview

  • Framework - DropWizard
  • Server - Jetty
  • REST - Jersey/JaxRs
  • Test - JUnit/Mockito

How to start the UnderArmour application

  1. Set the DATABASE_URL environment variable to "postgres://fhvequzhzcsbls:6e9dcc2e81b055bd7b9772eadd4f78be036e0bc17bd8d4efc4a1e2c7ac7e4401@ec2-107-22-211-182.compute-1.amazonaws.com:5432/de0hih3bm64i62" i.e.
    export DATABASE_URL="postgres://fhvequzhzcsbls:6e9dcc2e81b055bd7b9772eadd4f78be036e0bc17bd8d4efc4a1e2c7ac7e4401@ec2-107-22-211-182.compute-1.amazonaws.com:5432/de0hih3bm64i62"
  2. Run mvn clean install to download dependencies
  3. Run mvn package to create the jar
  4. Start application with java -jar target/UnderArmour-1.0-SNAPSHOT.jar server config.yml
  5. To check that your application is running enter url http://localhost:8080

Tests

  • To run tests, run mvn test

Resources

  • [POST] /chat - Creates a chat object.

    Example request:
{
"user": "user1", "text": "hello"
}


Example Response

{
"id": 0001
}
  • [GET] /chat/{id} - Retrieves a chat object by id.

    Example Response
[
{
"id": 433961,
"text": "hello",
"username": "user1",
"expirationDate": "2017-12-16 22:07:29 PM UTC"
}
]
  • [GET] /chat/user/{username} - Retrieves a list of unexpired chats for the username.

    Example Response
[
{
"id": 136219,
"text": "hello"
},
{
"id": 255622,
"text": "hello"
},
{
"id": 7752,
"text": "hello"
},
{
"id": 399944,
"text": "hello"
},
{
"id": 305906,
"text": "hello"
},
{
"id": 410662,
"text": "hello"
}
]

About

underarmour take home

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages