1 package de.mxro.webapiexample;
2
3 import de.mxro.webapiexample.internal.WebApiServerImpl;
4
5
6
7
8
9
10 public class WebApi {
11
12
13
14
15
16 public static void main(String[] args) {
17 int port = 8989;
18 if (args.length == 1) {
19 try {
20 port = Integer.valueOf(args[0]);
21 } catch (NumberFormatException ex) {
22 System.out.println("Please provide a valid port number as a parameter.");
23 return;
24 }
25 }
26
27
28 WebApiServer server = createServer();
29 server.start(port);
30 }
31
32
33
34
35
36
37 public static WebApiServer createServer() {
38
39 return new WebApiServerImpl();
40
41 }
42
43 }