Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1002642 // mainURL

JavaX fragment (include)

1  
// best guess for our main URL (with trailing /)
2  
// should improve (return actual server name!)
3  
static S mainURL() {
4  
  O bot = getBot("#1002596"); // System URL Bot
5  
  if (bot != null) pcall {
6  
    S url = (S) call(bot, "getBaseURL");
7  
    if (nempty(url))
8  
      ret addSlash(url);
9  
  }
10  
  int port = webServerPort();
11  
  ret "http://" + myBestIP() + (port == 80 ? "" : ":" + port) + "/";
12  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002642
Snippet name: mainURL
Eternal ID of this version: #1002642/1
Text MD5: 55afb8936b80870573c119f53d3a3221
Author: stefan
Category: nl bots
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-14 17:23:05
Source code size: 396 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 739 / 682
Referenced in: [show references]