Skip to content

Commit

Permalink
Add larger file upload limit
Browse files Browse the repository at this point in the history
  • Loading branch information
VerisimilitudeX committed Feb 18, 2025
1 parent c7578a5 commit 0b5366c
Show file tree
Hide file tree
Showing 9 changed files with 942 additions and 212 deletions.
36 changes: 13 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'java'
id 'application'
id("org.openjfx.javafxplugin") version "0.0.13"
id("maven-publish")
id 'java'
id 'org.springframework.boot' version '3.1.4'
id 'io.spring.dependency-management' version '1.1.3'
}

group = 'com.dnanalyzer'
version = '1.2.1'
sourceCompatibility = '17'
targetCompatibility = '17'

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

Expand All @@ -24,38 +24,29 @@ javafx {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.json:json:20230227'
implementation 'info.picocli:picocli:4.7.5'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'javax.validation:validation-api:2.0.1.Final'

compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.2.0'

// Use JUnit test framework.
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.2"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.2"
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.1'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// This dependency is used by the application.
implementation 'com.google.guava:guava:31.0.1-jre'

// Picocli
implementation 'info.picocli:picocli:4.6.3'

// Sentry SDK
implementation 'io.sentry:sentry:6.10.0'

implementation 'org.controlsfx:controlsfx:11.1.2'

// OpenAI-GPT-3
implementation group: 'com.github.plexpt', name: 'chatgpt', version: '4.0.1'
implementation 'com.theokanning.openai-gpt3-java:service:0.11.1'

// JSON Parser
implementation 'org.json:json:20210307'
}

application {
// Define the main class for the application.
mainClass = 'DNAnalyzer.Main'
}

Expand Down Expand Up @@ -93,7 +84,6 @@ test {
maxHeapSize = "2g"
}


jar {
manifest {
attributes 'Main-Class': 'DNAnalyzer.Main'
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/DNAnalyzer/DNAnalyzerApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.web.context.request.WebRequest;
import java.util.Map;

/**
* Spring Boot Application configuration for DNAnalyzer web server.
Expand All @@ -29,4 +33,18 @@ public void addCorsMappings(CorsRegistry registry) {
}
};
}

@Bean
public ErrorAttributes errorAttributes() {
return new DefaultErrorAttributes() {
@Override
public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
Map<String, Object> errorAttributes = super.getErrorAttributes(webRequest, includeStackTrace);
errorAttributes.put("status", errorAttributes.get("status"));
errorAttributes.put("error", errorAttributes.get("error"));
errorAttributes.put("message", errorAttributes.get("message"));
return errorAttributes;
}
};
}
}
Loading

0 comments on commit 0b5366c

Please sign in to comment.