This commit is contained in:
Braydon 2024-04-05 22:47:26 -04:00
parent 43d29f1401
commit 100547514d
4 changed files with 77 additions and 0 deletions

@ -35,11 +35,20 @@
<!-- Depends --> <!-- Depends -->
<dependencies> <dependencies>
<!-- Spring -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<!-- Libraries -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<!-- Tests --> <!-- Tests -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

@ -0,0 +1,33 @@
package me.braydon.mc;
import lombok.NonNull;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Objects;
/**
* @author Braydon
*/
@SpringBootApplication
@Slf4j(topic = "RESTfulMC")
public final class RESTfulMC {
@SneakyThrows
public static void main(@NonNull String[] args) {
File config = new File("application.yml");
if (!config.exists()) { // Saving the default config if it doesn't exist locally
Files.copy(Objects.requireNonNull(RESTfulMC.class.getResourceAsStream("/application.yml")), config.toPath(), StandardCopyOption.REPLACE_EXISTING);
log.info("Saved the default configuration to '{}', please re-launch the application", // Log the default config being saved
config.getAbsolutePath()
);
return;
}
log.info("Found configuration at '{}'", config.getAbsolutePath()); // Log the found config
SpringApplication.run(RESTfulMC.class, args);
}
}

@ -0,0 +1,25 @@
# Server Configuration
server:
address: 0.0.0.0
port: 7500
# Log Configuration
logging:
file:
path: "./logs"
# Spring Configuration
spring:
data:
# Redis - This is used for caching
redis:
host: "127.0.0.1"
port: 6379
database: 0
auth: "" # Leave blank for no auth
# Ignore
application:
name: "RESTfulMC"
banner:
location: "classpath:banner.txt"

@ -0,0 +1,10 @@
_____ ______ _____ _______ __ _ __ __ _____
| __ \| ____|/ ____|__ __/ _| | | \/ |/ ____|
| |__) | |__ | (___ | | | |_ _ _| | \ / | |
| _ /| __| \___ \ | | | _| | | | | |\/| | |
| | \ \| |____ ____) | | | | | | |_| | | | | | |____
|_| \_\______|_____/ |_| |_| \__,_|_|_| |_|\_____|
| API Version - v${application.version}
| Spring Version - ${spring-boot.formatted-version}
_______________________________________