Commit 69ac054b by Patryk Czarnik

/rest/hello/time

parent ab3dd39d
......@@ -3,7 +3,7 @@ package sklep.rest;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;
@ApplicationPath("/")
@ApplicationPath("/rest")
public class AplikacjaRestowa extends Application {
// Ta klasa jest konfiguracją usługi RESTowej. Jedna taka klasa powinna się znajdować w projekcie.
// Jeśli chcemy zdać się na domyślną konfigurację, pozostawiamy tę klasę pustą.
......
package sklep.rest;
import java.time.LocalDateTime;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
......@@ -10,5 +12,11 @@ public class RHello {
public String hello() {
return "Hello world!";
}
@GET
@Path("/time")
public String currentTime() {
return LocalDateTime.now().toString();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment