Initial commit
This commit is contained in:
commit
aa4e110832
69 changed files with 17898 additions and 0 deletions
40
src/wa/server/WebAdminServer.java
Normal file
40
src/wa/server/WebAdminServer.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package wa.server;
|
||||
|
||||
import wa.server.page.AbstractPage;
|
||||
import wa.server.page.StatusPage;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.CompactLogFormatter;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpServer;
|
||||
import zutil.net.http.pages.HttpFilePage;
|
||||
import zutil.plugin.PluginManager;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class WebAdminServer {
|
||||
private static Logger log = LogUtil.getLogger();
|
||||
|
||||
private PluginManager pluginManager;
|
||||
|
||||
public static void main(String[] args){
|
||||
LogUtil.setGlobalLevel(Level.FINEST);
|
||||
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
||||
|
||||
new WebAdminServer();
|
||||
}
|
||||
|
||||
public WebAdminServer(){
|
||||
try {
|
||||
pluginManager = new PluginManager();
|
||||
|
||||
HttpServer http = new HttpServer(80);
|
||||
http.setPage("/", new StatusPage(pluginManager));
|
||||
http.setDefaultPage(new HttpFilePage(FileUtil.find("WebContent/")));
|
||||
http.start();
|
||||
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue