https://github.com/skapral/jersey-se
Compact JAX-RS distribution based on Grizzly and Jersey
https://github.com/skapral/jersey-se
grizzly java jax-rs jersey standalone-server
Last synced: 17 days ago
JSON representation
Compact JAX-RS distribution based on Grizzly and Jersey
- Host: GitHub
- URL: https://github.com/skapral/jersey-se
- Owner: skapral
- License: mit
- Created: 2019-02-01T19:34:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-15T02:23:48.000Z (almost 4 years ago)
- Last Synced: 2025-02-13T00:19:37.632Z (2 months ago)
- Topics: grizzly, java, jax-rs, jersey, standalone-server
- Language: Java
- Size: 92.8 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jersey Standalone
[](https://travis-ci.org/skapral/jersey-se)
[](https://ci.appveyor.com/project/skapral/jersey-se/branch/master)
[](https://codecov.io/gh/skapral/jersey-se)Compact self-sufficient JAX-RS distribution based on Grizzly and Jersey.
## Quick start
1. Add Maven dependency
```
com.github.skapral.jersey.se
jersey-se
x.y.z```
2. Define JAX-RS resource config
```
public class SimpleConfig extends ResourceConfig {
/**
* Ctor.
*/
public SimpleConfig() {
super(
StatusEndpoint.class
);
}
}@Path("status")
public class StatusEndpoint {
/**
* @return returns "OK"
*/
@GET
@Produces(MediaType.TEXT_PLAIN)
public String status() {
return "OK";
}
}
```3. Define entry point.
```
public static void main(String... args) throws Exception {
new SrvGrizzlyWithJersey(
new Cp_PORT(),
new SimpleConfig()
).start();
System.in.read(); // Server instance uses daemon threads, so hold
// main thread until you need the server online.
}
```4. Run the instance.