Skip to content

Commit

Permalink
Replaced restx-server-simple by restx-server-jetty in samplest since …
Browse files Browse the repository at this point in the history
…restx-server-simple doesn't propagate exceptions occuring during route processing,

which makes debugging very hard (and seems things are not working at all).
With restx-server-jetty, when an exception is raised, it is displayed into the HTTP response body
  • Loading branch information
fcamblor committed Jan 19, 2017
1 parent 85c11f2 commit e77f848
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion restx-samplest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>io.restx</groupId>
<artifactId>restx-server-simple</artifactId>
<artifactId>restx-server-jetty</artifactId>
</dependency>
<dependency>
<groupId>io.restx</groupId>
Expand Down
8 changes: 6 additions & 2 deletions restx-samplest/src/main/java/samplest/AppServer.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package samplest;

import com.google.common.base.Optional;
import restx.server.JettyWebServer;
import restx.server.WebServer;
import restx.server.simple.simple.SimpleWebServer;
//import restx.server.simple.simple.SimpleWebServer;

/**
* Date: 1/12/13
* Time: 14:18
*/
public class AppServer {
public static final String WEB_INF_LOCATION = "src/main/webapp/WEB-INF/web.xml";
public static final String WEB_APP_LOCATION = "src/main/webapp";

public static void main(String[] args) throws Exception {
int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8080"));
WebServer server = SimpleWebServer.builder().setRouterPath("/api").setPort(port).build();
WebServer server = new JettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0");

/*
* load mode from system property if defined, or default to dev
Expand Down

0 comments on commit e77f848

Please sign in to comment.