mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-25 18:54:36 +01:00
23 lines
542 B
Java
23 lines
542 B
Java
package emu.nebula.server.routes;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import io.javalin.http.ContentType;
|
|
import io.javalin.http.Context;
|
|
import io.javalin.http.Handler;
|
|
|
|
public class HttpJsonResponse implements Handler {
|
|
private final String json;
|
|
|
|
public HttpJsonResponse(String jsonString) {
|
|
this.json = jsonString;
|
|
}
|
|
|
|
@Override
|
|
public void handle(@NotNull Context ctx) throws Exception {
|
|
ctx.status(200);
|
|
ctx.contentType(ContentType.APPLICATION_JSON);
|
|
ctx.result(json);
|
|
}
|
|
}
|