本文整理了Java中spark.Spark.ipAddress()
方法的一些代码示例,展示了Spark.ipAddress()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spark.ipAddress()
方法的具体详情如下:
包路径:spark.Spark
类名称:Spark
方法名:ipAddress
[英]Set the IP address that Spark should listen on. If not called the default address is '0.0.0.0'. This has to be called before any route mapping is done.
[中]设置Spark应该监听的IP地址。如果未调用,则默认地址为“0.0.0.0”。在完成任何路由映射之前,必须调用该函数。
代码示例来源:origin: bwssytems/ha-bridge
log.info("HA Bridge (v" + theVersion.getVersion() + ") initializing....");
ipAddress(bridgeSettings.getBridgeSettingsDescriptor().getWebaddress());
代码示例来源:origin: yeriomin/token-dispenser
ipAddress(host);
port(port);
notFound("Not found");
代码示例来源:origin: pyloque/captain
public void start() {
Spark.ipAddress(config.bindHost());
Spark.port(config.bindPort());
Spark.threadPool(config.threadNum());
Spark.staticFileLocation("/static");
if (!config.readonly()) {
this.initWritableHandlers();
}
this.initReadonlyHandlers();
this.initViewHandlers();
this.initExceptionHandlers();
Spark.awaitInitialization();
LOG.warn("captain server started");
}
代码示例来源:origin: pengrad/java-telegram-bot-api
public static void main(String[] args) throws Exception {
ipAddress(args[0]);
port(Integer.parseInt(args[1]));
get("/hello", (req, res) -> "Hello World");
post("/test", new Test());
get("/test", new Test());
get("/kurs", (request, response) -> new KursBot().getAllKurs());
post("/kursBot", new KursBot());
BotHandler botHandler = new AqivnBot();
post("/" + botHandler.getToken(), botHandler);
String appSite = System.getenv("OPENSHIFT_APP_DNS");
botHandler.getBot().execute(new SetWebhook().url(appSite + "/" + botHandler.getToken()));
}
代码示例来源:origin: iNPUTmice/caas
staticFileLocation("/public");
webSocket("/socket/*", TestLiveWebsocket.class);
ipAddress(Configuration.getInstance().getIp());
port(Configuration.getInstance().getPort());
before((request, response) -> {
内容来源于网络,如有侵权,请联系作者删除!