Iteration 0
This commit is contained in:
11
src/main/java/se/urmo/hemhub/HemhubApplication.java
Normal file
11
src/main/java/se/urmo/hemhub/HemhubApplication.java
Normal file
@ -0,0 +1,11 @@
|
||||
package se.urmo.hemhub;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class HemhubApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(HemhubApplication.class, args);
|
||||
}
|
||||
}
|
||||
23
src/main/java/se/urmo/hemhub/web/PublicController.java
Normal file
23
src/main/java/se/urmo/hemhub/web/PublicController.java
Normal file
@ -0,0 +1,23 @@
|
||||
package se.urmo.hemhub.web;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
public class PublicController {
|
||||
|
||||
@Value("${app.version:dev}")
|
||||
String version;
|
||||
|
||||
@GetMapping("/public/info")
|
||||
public Map<String, Object> info() {
|
||||
return Map.of(
|
||||
"name", "HemHub API",
|
||||
"version", version,
|
||||
"timestamp", Instant.now().toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
13
src/main/resources/application.yml
Normal file
13
src/main/resources/application.yml
Normal file
@ -0,0 +1,13 @@
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:postgresql://postgres:5432/hemhub
|
||||
username: hemhub
|
||||
password: hemhub
|
||||
jpa:
|
||||
hibernate:
|
||||
ddl-auto: none
|
||||
flyway:
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user