本文整理汇总了Java中restx.server.WebServer类的典型用法代码示例。如果您正苦于以下问题:Java WebServer类的具体用法?Java WebServer怎么用?Java WebServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebServer类属于restx.server包,在下文中一共展示了WebServer类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main( String[] args ) throws Exception {
int port = Integer.valueOf( Optional.fromNullable( System.getenv( "PORT" ) ).or( "10043" ) );
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
* be careful with that setting, if you use this class to launch your server in production, make sure to launch
* it with -Drestx.mode=prod or change the default here
*/
System.setProperty( "restx.mode", System.getProperty( "restx.mode", "dev" ) );
System.setProperty( "restx.app.package", "com.formulasearchengine.backend.basex" );
String path = System.getProperty( "path" );
Server srv = null;
System.out.println("admin password is " + System.getProperty( "password" ));
try {
srv = new Server();
System.out.println( "importing data from " + path );
srv.importData( path );
} catch ( IOException e ) {
e.printStackTrace();
}
server.startAndAwait();
}
示例2: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main( String[] args ) throws Exception {
int port = Integer.valueOf( Optional.fromNullable( System.getenv( "PORT" ) ).or( "10043" ) );
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
* be careful with that setting, if you use this class to launch your server in production, make sure to launch
* it with -Drestx.mode=prod or change the default here
*/
System.setProperty( "restx.mode", System.getProperty( "restx.mode", "dev" ) );
System.setProperty( "restx.app.package", "com.formulasearchengine.backend.basex" );
String path = System.getProperty( "path" , System.getProperty( "defaultPath" ) );
Server srv = null;
System.out.println("admin password is " + System.getProperty( "password" , "mathosphere" ) );
try {
System.out.println( "importing data from " + path );
File f = new File( path );
srv = Server.getInstance();
srv.startup(f);
} catch ( IOException e ) {
e.printStackTrace();
}
server.startAndAwait();
}
示例3: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
/*
* load mode from system property if defined, or default to dev
* be careful with that setting, if you use this class to launch your server in production, make sure to launch
* it with -Drestx.mode=prod or change the default here
*/
String mode = System.getProperty("restx.mode", "dev");
System.setProperty("restx.mode", mode);
System.setProperty("restx.app.package", "com.vino");
int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8080"));
WebServer server = new JettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0");
System.setProperty("restx.server.id", server.getServerId());
System.setProperty("restx.server.baseURL", server.baseUrl());
server.startAndAwait();
}
示例4: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("9090"));
WebServer server = SimpleWebServer.builder().setRouterPath("").setPort(port).build();
EndpointManager.getEndpointManager().setDefaultEndpoint(new CoapEndpoint(new InetSocketAddress("2001:0470:cafe::38b2:cf50",23498)));
/*
* load mode from system property if defined, or default to prod
* when using this class to launch your server in development, launch it with -Drestx.mode=dev
*/
System.setProperty("restx.mode", System.getProperty("restx.mode", "prod"));
System.setProperty("restx.app.package", "dynamicserver");
server.startAndAwait();
System.out.println("VISIT " + server.baseUrl() + "/ for Semantics IDE");
}
示例5: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8081"));
WebServer server = new JettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0");
System.setProperty("restx.mode", "prod");
System.setProperty("restx.app.package", "hello");
BigReactorSimulator.init();
server.startAndAwait();
}
示例6: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8080"));
WebServer server = new JettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0");
System.setProperty("restx.baseUri", server.baseUrl() + "/api");
server.startAndAwait();
}
示例7: main
import restx.server.WebServer; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8080"));
WebServer server = new JettyWebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0");
System.setProperty("restx.mode", System.getProperty("restx.mode", "prod"));
System.setProperty("restx.app.package", "fr.pilato.demo.legacysearch");
server.startAndAwait();
}