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

27
LINES

< > BotCompany Repo | #1021679 // Gazelle Web Server [LIVE at http://gazelle.botcompany.de, Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (32638L/194K).

1  
!7
2  
3  
!include #1022531 // DynGazelleWebServer
4  
5  
// we want our own structure() because of DynamicObject
6  
module GazelleWebServer > DynGazelleWebServer {
7  
  Request newRequest() { ret new Request; }
8  
  
9  
  class Request extends DynGazelleWebServer.Request {
10  
    O serve(S uri, SS params) {
11  
      S domain = serveHttp_domainName();
12  
      if (swicOneOf(domain, "ontology.", "monkey.")) {
13  
        // TODO: only works with text/html
14  
        S answer = (S) callF(dm_get('ontologyWebServer, 'serveFunction), uri, params);
15  
        if (answer != null) ret answer;
16  
      }
17  
      
18  
      if (!swic(domain, "gazelle.")) {
19  
        print("FREAK domain: " + domain);
20  
        try object spamTest();
21  
        ret serveRedirect("https://BotCompany.de");
22  
      }
23  
        
24  
      ret super.serve(uri, params);
25  
    }
26  
  }
27  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021679
Snippet name: Gazelle Web Server [LIVE at http://gazelle.botcompany.de, Dyn Module]
Eternal ID of this version: #1021679/438
Text MD5: 3b709c22ac56b3b1e2d4bf30b6748a7a
Transpilation MD5: f5be9e78575522ce5ce283e478825d42
Author: stefan
Category: javax / stefan's os / a.i. / web
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-25 21:29:38
Source code size: 818 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 1373 / 46278
Version history: 437 change(s)
Referenced in: [show references]