1234567891011121314151617181920212223242526272829 |
- package app;
- import net.javapla.jawn.server.UndertowServer;
- import net.javapla.jawn.server.spi.ServerConfig;
- import net.javapla.jawn.server.spi.ServerConfig.PERFORMANCE_MODE;
- public class UndertowMain {
- public static void main(String[] args) throws Exception {
- // Automatically set environment to production if nothing is specified
- // Framework defaults to development
- String environment = "production";
- if (args.length > 0) environment = args[0];
- System.setProperty("JAWN_ENV", environment);
-
- if (args.length > 1) System.setProperty("DBHOST", args[1]);
-
- ServerConfig config = new ServerConfig();
-
- config.setContextPath("/");
- config.setPort(8081);
- config.setWebappPath("webapp");
- config.setServerPerformance(PERFORMANCE_MODE.HIGHEST);
- if (args.length > 2) config.setHost(args[2]);
-
- UndertowServer server = new UndertowServer();
- server.setupAndStartServer(config);
- }
- }
|