1 package eu.fbk.dkm.pikes.tintop;
2
3 import org.glassfish.grizzly.http.server.CLStaticHttpHandler;
4 import org.glassfish.grizzly.http.server.HttpServer;
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7
8 import java.io.IOException;
9
10
11
12
13
14 public class ServerTest {
15
16 private static final Logger LOGGER = LoggerFactory.getLogger(ServerTest.class);
17
18 public static void main(String[] args) {
19
20 HttpServer httpServer = HttpServer.createSimpleServer("localhost", 8080);
21
22 httpServer.getServerConfiguration().addHttpHandler(
23 new CLStaticHttpHandler(HttpServer.class.getClassLoader(), "webdemo/"), "/demo/");
24
25
26
27 httpServer.getServerConfiguration().addHttpHandler(
28 new CLStaticHttpHandler(HttpServer.class.getClassLoader(), "webdemo/static/"), "/static/");
29
30 try {
31 httpServer.start();
32 Thread.currentThread().join();
33 } catch (IOException e) {
34 e.printStackTrace();
35 } catch (InterruptedException e) {
36 e.printStackTrace();
37 }
38
39 }
40 }