Skip to content

Commit

Permalink
Merge pull request #347 from UMM-CSci-3601/dependabot/gradle/server/i…
Browse files Browse the repository at this point in the history
…o.javalin-javalin-6.3.0

Bump io.javalin:javalin from 5.6.3 to 6.3.0 in /server
  • Loading branch information
NicMcPhee authored Aug 29, 2024
2 parents e414c13 + 4125819 commit d39fa62
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
6 changes: 3 additions & 3 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ plugins {
id 'checkstyle'
}

// Build and run the project with Java 17
// Build and run the project with Java 21
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand All @@ -29,7 +29,7 @@ repositories {
// External dependencies that our application utilizes
dependencies {
// Javalin, a simple web framework for Java
implementation 'io.javalin:javalin:5.6.3'
implementation 'io.javalin:javalin:6.3.0'

// Jackson, a JSON library for Java
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
Expand Down
3 changes: 1 addition & 2 deletions server/src/main/java/umm3601/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.javalin.Javalin;
import io.javalin.http.InternalServerErrorResponse;
import io.javalin.http.staticfiles.Location;
import io.javalin.plugin.bundled.RouteOverviewPlugin;

public class Server {

Expand Down Expand Up @@ -78,7 +77,7 @@ private Javalin configureJavalin() {
// This adds a Javalin plugin that will list all of the
// routes/endpoints that we add below on a page reachable
// via the "/api" path.
config.plugins.register(new RouteOverviewPlugin("/api"));
config.bundledPlugins.enableRouteOverview("/api");
});

// This catches any uncaught exceptions thrown in the server
Expand Down
14 changes: 14 additions & 0 deletions server/src/main/java/umm3601/user/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,18 @@ public class User {
public int age;
public String company;
public String email;

// Having some kind of `toString()` allows us to print `User`s,
// which can be useful/necessary in error handling. This only
// returns the name, but it could be extended to return more or
// all of the fields combined into a single string.
//
// The other option would be to return `_id`, but that can be
// `null` if we're trying to add a new `User` to the database
// that doesn't yet have an `_id`, so returning `name` seemed
// the better bet.
@Override
public String toString() {
return name;
}
}

0 comments on commit d39fa62

Please sign in to comment.