URL-3 Spring Boot skeletons for the service

This commit is contained in:
LenaGmbh
2025-12-16 17:58:35 +01:00
parent 9ecf26eee5
commit 23241f4af1
13 changed files with 213 additions and 11 deletions

View File

@@ -0,0 +1,23 @@
plugins {
id 'java'
}
group 'me.lenajenichen'
version '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}
springBoot {
mainClass = 'shortener.ShortenerServiceApplication'
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
useJUnitPlatform()
}

View File

@@ -0,0 +1,15 @@
package api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/health")
public class HealthController {
@GetMapping
public String health() {
return "OK";
}
}

View File

@@ -0,0 +1,15 @@
package shortener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {"shortener", "api"})
public class ShortenerServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ShortenerServiceApplication.class, args);
}
}

View File

@@ -0,0 +1,6 @@
spring:
application:
name: shortener-service
server:
port: 8083