Skip to content

Instantly share code, notes, and snippets.

@solsend2l
Forked from danveloper/ratpack.md
Last active August 29, 2015 14:13
Show Gist options
  • Save solsend2l/531abd6316c4cd88bfe1 to your computer and use it in GitHub Desktop.
Save solsend2l/531abd6316c4cd88bfe1 to your computer and use it in GitHub Desktop.

build.gradle

buildscript {
  repositories {
    jcenter()
    maven { url "http://oss.jfrog.org/oss-snapshot-local" }
    maven { url "http://clinker.netty.io/nexus/content/repositories/snapshots" }
  }
  dependencies {
    classpath 'io.ratpack:ratpack-gradle:0.9.13-SNAPSHOT'
  }
}

apply plugin: 'io.ratpack.ratpack-java'
apply plugin: 'idea'

repositories {
  jcenter()
  maven { url "http://oss.jfrog.org/oss-snapshot-local" }
  maven { url "http://clinker.netty.io/nexus/content/repositories/snapshots" }
}

dependencies {
  runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.0.1'
  runtime 'org.apache.logging.log4j:log4j-api:2.0.1'
  runtime 'org.apache.logging.log4j:log4j-core:2.0.1'
  runtime 'com.lmax:disruptor:3.3.0'
}

src/main/java/perf/Main.java

package perf;

import ratpack.server.RatpackServer;
import ratpack.server.ServerConfig;

public class Main {

    public static void main(String[] args) throws Exception {
        RatpackServer server = RatpackServer.of(b -> b.
                config(ServerConfig.noBaseDir()).
                handlers(chain -> chain.
                    get(ctx -> ctx.render("Hello World!"))
                )
        );

        server.start();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment