Java Code Examples for io.javalin.Javalin#create()

The following examples show how to use io.javalin.Javalin#create() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValidatorGui.java    From org.hl7.fhir.core with Apache License 2.0 5 votes vote down vote up
public static void start(CliContext currentContext, ValidationEngine validationEngine, boolean bootBrowser) {
  app = Javalin.create();
  new RestEndpoints().initRestEndpoints(app, currentContext, validationEngine);
  app.config.addStaticFiles(WEB_APP_FILE_LOCATION);
  app.start(GUI_FRONTEND_PORT);
  if (bootBrowser) {
    openBrowser();
  }
}
 
Example 2
Source File: BeaconRestApi.java    From teku with Apache License 2.0 5 votes vote down vote up
public BeaconRestApi(final DataProvider dataProvider, final TekuConfiguration configuration) {
  this.app =
      Javalin.create(
          config -> {
            config.registerPlugin(
                new OpenApiPlugin(getOpenApiOptions(jsonProvider, configuration)));
            config.defaultContentType = "application/json";
            config.logIfServerNotStarted = false;
            config.showJavalinBanner = false;
          });
  initialize(dataProvider, configuration);
}
 
Example 3
Source File: TimelineService.java    From hudi with Apache License 2.0 5 votes vote down vote up
public int startService() throws IOException {
  app = Javalin.create();
  FileSystemViewHandler router = new FileSystemViewHandler(app, conf, fsViewsManager);
  app.get("/", ctx -> ctx.result("Hello World"));
  router.register();
  app.start(serverPort);
  // If port = 0, a dynamic port is assigned. Store it.
  serverPort = app.port();
  LOG.info("Starting Timeline server on port :" + serverPort);
  return serverPort;
}
 
Example 4
Source File: JavalinService.java    From elepy with Apache License 2.0 4 votes vote down vote up
public JavalinService() {
    this.javalin = Javalin.create();
    this.port = 1337;
}
 
Example 5
Source File: DefaultReportsServer.java    From maestro-java with Apache License 2.0 3 votes vote down vote up
public DefaultReportsServer() {
    app = Javalin.create();

    configure(app);

    registerUris(app);
}