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

17
LINES

< > BotCompany Repo | #1001784 // Connect an http() bot as web server

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2379L/18K/47K).

!747

m {
  static S botID = "#1001782";
  static Class bot;
  
  p {
    bot = hotwire(botID);
    serveHttp(7778);
  }
  
  static NanoHTTPD.Response serve(S uri, NanoHTTPD.Method method,
    Map<S,S> header, Map<S,S> parms, Map<S,S> files) {
    print("Serving HTTP " + quote(uri) + " from " + botID);
    ret serveHTML((S) callOpt(bot, "html"));
  }
}

Author comment

Began life as a copy of #1001649

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001784
Snippet name: Connect an http() bot as web server
Eternal ID of this version: #1001784/1
Text MD5: d59fb2e6c0249466c78581c21de773e5
Transpilation MD5: fd7c73ad2b0c3889679d4fff3a3dce43
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-27 16:47:30
Source code size: 371 bytes / 17 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 705 / 741
Referenced in: [show references]