Uses 911K of libraries. Click here for Pure Java version (6775L/38K).
1 | !7 |
2 | |
3 | cmodule ImagerSite extends DynPrintLogAndEnabled { |
4 | switchable int httpPort = 80; |
5 | switchable int httpsPort = 443; |
6 | transient autoDispose MyHTTPD server; |
7 | transient autoDispose MyHTTPD secureServer; |
8 | |
9 | start { |
10 | if (!enabled) ret; |
11 | server = new MyHTTPD(httpPort); |
12 | server.enter = lambda0 enter; |
13 | server.serveFunction = func(S uri, SS parms) { serve(uri, parms) }; |
14 | server.start(); |
15 | print("HTTP server started on port " + server.getPort()); |
16 | |
17 | if (httpsPort == 0) ret; |
18 | secureServer = new MyHTTPD(httpsPort); |
19 | secureServer.makeSecure(serveHttps_makeSSLSocketFactory(javaxSecretDir("imager.site.keystore.pkcs12"), "botcompany")); |
20 | secureServer.serveFunction = func(S uri, SS parms) { serve(uri, parms) }; |
21 | secureServer.start(); |
22 | print("HTTPS server started on port " + secureServer.getPort()); |
23 | } |
24 | |
25 | O serve(S uri, SS params) enter { |
26 | ret hhtml(hhead_title("imager.site - the imaging chat bot") |
27 | + hbody(hWebChatBot(#1026248))); |
28 | } |
29 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026245 |
Snippet name: | imager.site |
Eternal ID of this version: | #1026245/13 |
Text MD5: | 5537f6985cb7fa6b5f4e45642c53a2af |
Transpilation MD5: | b0a92dd666ec35deef05c83826e1cbd8 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-12-19 12:04:05 |
Source code size: | 1019 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 226 / 588 |
Version history: | 12 change(s) |
Referenced in: | [show references] |