Skip to content

Commit

Permalink
added java and gradle resources
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolagospagopa committed Dec 20, 2024
1 parent 9218451 commit 2788e14
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 4 deletions.
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
plugins {
id 'org.springframework.boot' version '2.5.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}

group = 'it.pagopa.status'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
useJUnitPlatform()
}
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: "3.8"
services:
status:
status-service:
build:
dockerfile: ./Dockerfile
context: .
container_name: status
dockerfile: Dockerfile
container_name: status-service
restart: always
ports:
- "8000:8000"
- "8000:8080"
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'status-service'
11 changes: 11 additions & 0 deletions src/main/java/it/pagopa/status/StatusApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package it.pagopa.status;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class StatusApplication {
public static void main(String[] args) {
SpringApplication.run(StatusApplication.class, args);
}
}
29 changes: 29 additions & 0 deletions src/main/java/it/pagopa/status/controller/StatusController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package it.pagopa.status.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StatusController {

@GetMapping("/")
public ResponseEntity<Void> home() {
return ResponseEntity.ok().build();
}

@GetMapping("/status")
public ResponseEntity<Void> status() {
return ResponseEntity.ok().build();
}

@GetMapping("/health")
public ResponseEntity<Void> health() {
return ResponseEntity.ok().build();
}

@GetMapping("/healthz")
public ResponseEntity<Void> healthz() {
return ResponseEntity.ok().build();
}
}
3 changes: 3 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
server.port=8000
spring.application.name=status-service
spring.main.banner-mode=off

0 comments on commit 2788e14

Please sign in to comment.