Пример #1
0
  /**
   * Register the MetricsPlugin with the RestExpress server.
   *
   * @param server a RestExpress server instance.
   * @return MetricsPlugin
   */
  @Override
  public MetricsPlugin register(RestExpress server) {
    if (isRegistered) return this;

    server.registerPlugin(this);
    this.isRegistered = true;

    server.addMessageObserver(this).addPreprocessor(this).addPostprocessor(this);

    return this;
  }
 public static void main(String[] args) {
   RestExpress server = (new RestExpress()).setPort(8080);
   server.uri("/log", new LogService());
   server.bind();
   server.awaitShutdown();
 }
 public ApiDeclarations(ApiResources api, RestExpress server, String path) {
   this.apiVersion = api.getApiVersion();
   this.swaggerVersion = api.getSwaggerVersion();
   this.basePath = server.getBaseUrl();
   this.resourcePath = path;
 }