public static void main(String[] args) throws Exception { Config.Builder b = new Config.Builder(); b.resource(args[0]).port(8080).host("127.0.0.1"); Nettosphere s = new Nettosphere(b.build()); s.start(); String a = ""; logger.info("NettoSphere Server started"); logger.info("Type quit to stop the server"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while (!(a.equals("quit"))) { a = br.readLine(); } System.exit(-1); }
public static void main(String[] args) throws IOException { Config.Builder b = new Config.Builder(); b.resource(Chat.class) .resource("./webapps") // for debugging inside IntelJ .resource("./wasync-samples/chat/src/main/resources") .port(8080) .host("127.0.0.1") .build(); Nettosphere s = new Nettosphere.Builder().config(b.build()).build(); s.start(); String a = ""; logger.info("NettoSphere Chat Server started on port {}", 8080); logger.info("Type quit to stop the server"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while (!(a.equals("quit"))) { a = br.readLine(); } System.exit(-1); }
/** Initializes the server and starts it. */ public void start() { server = new Nettosphere.Builder() .config( new Config.Builder() .host(host) .resource("/*", atmosphereHandler) .port(port) .build()) .build(); server.start(); }
/** Stops the server. */ public void stop() { log.info("stopping nettosphere server ..."); server.stop(); log.info("nettosphere stopped"); }