Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
src/main/java/com/soklet/jetty
.classpath
.gitignore
.project
CONTRIBUTING.md
LICENSE
README.md
pom.xml

README.md

Soklet Jetty

What Is It?

Jetty integration for Soklet, a minimalist infrastructure for Java webapps and microservices.

License

Apache 2.0

Maven Installation

<dependency>
  <groupId>com.soklet</groupId>
  <artifactId>soklet-jetty</artifactId>
  <version>1.0.14</version>
</dependency>

Direct Download

If you don't use Maven, you can drop soklet-jetty-1.0.14.jar directly into your project. You'll also need Jetty 9 as a dependency.

Example Code

// Assumes you're using Guice as your DI framework via soklet-guice
public static void main(String[] args) throws Exception {
  Injector injector = createInjector(Modules.override(new SokletModule()).with(new AppModule()));
  Server server = injector.getInstance(Server.class);

  // Start the server
  new ServerLauncher(server).launch(StoppingStrategy.ON_KEYPRESS, () -> {
    // Some custom on-server-shutdown code here, if needed
  });
}

class AppModule extends AbstractModule {
  @Inject
  @Provides
  @Singleton
  public Server provideServer(InstanceProvider instanceProvider) {
    // We'll have Jetty be our Soklet server
    return JettyServer.forInstanceProvider(instanceProvider).port(8080).build();
  }
}

See the Soklet website for complete documentation of server configuration options.

About

Soklet Jetty was created by Mark Allen and sponsored by Transmogrify, LLC.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.