Last active
November 16, 2016 00:50
-
-
Save ljnelson/b4058eef43537313e84e0a429c7ea68f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2016 Laird Nelson. Released under the terms of the MIT license: https://opensource.org/licenses/MIT | |
*/ | |
package developer; | |
import java.util.Collections; | |
import java.util.Set; | |
import javax.ws.rs.core.Application; | |
import javax.enterprise.context.ApplicationScoped; | |
@ApplicationScoped | |
public class HelloWorldApplication extends Application { | |
public HelloWorldApplication() { | |
super(); | |
} | |
@Override | |
public Set<Class<?>> getClasses() { | |
return Collections.singleton(HelloWorldResource.class); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2016 Laird Nelson. Released under the terms of the MIT license: https://opensource.org/licenses/MIT | |
*/ | |
package developer; | |
import javax.enterprise.context.RequestScoped; | |
import javax.inject.Inject; | |
import javax.ws.rs.core.Application; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
@Path("hello") | |
@RequestScoped | |
public class HelloWorldResource { | |
@GET | |
@Produces("text/plain") | |
public String hello() { | |
return "Hello, world!"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment