Skip to content

dsusmit63/java-quotes-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java-Quotes-App

This project is a simple Java-based HTTP server that serves random motivational quotes via a REST API. The quotes are externalized to a quotes.txt file for easy customization.

Features

  • Serves random motivational quotes in JSON format.
  • Uses an external quotes.txt file for configurable quotes.
  • Dockerized for easy deployment.

Requirements

  • Java 17+
  • Maven (if building from source)
  • Docker (for containerized deployment)

Usage/Examples

Running Locally

  1. Clone the repository:
git clone https://github.com/dsusmit63/java-quotes-app.git
cd java-quotes-app
  1. Ensure quotes.txt exists in the project directory and contains quotes (one per line).
  2. Compile and run the application:
javac src/Main.java -d out
java -cp out Main
  1. The server will start on http://localhost:8000

Running With Docker

  1. Build the docker image:
docker build -t java-quotes-app:latest .
  1. Run the container:
docker run -d -p 8000:8000 --name java-quotes-app java-quotes-app:latest
  1. Access the application at http://localhost:8000

File Structure

project-root/
│── src/
│   └── Main.java
│── quotes.txt
│── Dockerfile
│── README.md
│── target/
│   └── myapp.jar (if using Maven build)

Customizing quotes

To customize the quotes, edit quotes.txt and restart the application. Each quote should be on a new line.

Author

About

Basic dockerized java application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •