k8s-restservice is a simple Kotlin-based Spring Boot application that provides a REST API endpoint returning "Hello World" as a response. This project is designed to demonstrate basic Spring Boot functionality and Docker integration.
- Getting Started
- Prerequisites
- Building and Running Locally
- Running with Docker
- API Endpoints
- Configuration
- Contributing
- License
These instructions will help you set up and run the HelloWorldService on your local machine for development and testing purposes.
-
Clone the repository:
git clone https://github.com/yourusername/helloworldservice.git cd helloworldservice
-
Build the project:
./gradlew build
-
Run the application:
./gradlew bootRun
-
Access the application:
Visit
http://localhost:8080/api/hello
in your browser or use a tool likecurl
:curl http://localhost:8080/api/hello
You should see the response:
Hello World
-
Build the Docker image:
docker build -t helloworldservice:latest .
-
Run the Docker container:
docker run -p 8080:8080 helloworldservice:latest
-
Access the application:
Visit
http://localhost:8080/api/hello
in your browser or use a tool likecurl
:curl http://localhost:8080/api/hello
The HelloWorldService provides the following endpoint:
GET /api/hello
- Returns "Hello World".
The application can be configured via the application.properties
or application.yml
file located in the src/main/resources
directory.
server.port=8080
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name
). - Commit your changes (
git commit -am 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature-name
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.