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

16
LINES

< > BotCompany Repo | #1014036 // Serve Snippets (botcompany.de/serve/{id})

JavaX source code (desktop) [tags: butter use-pretranspiled] - run with: x30.jar - homepage

Download Jar. Libraryless. Click here for Pure Java version (6020L/35K).

!7

html {
  uri = dropPrefix("/", uri);
  long id = parseLong(uri);
  S contentType = or(params.get("ct"), params.get("contentType"));
  bool maxCache = eq(params.get("maxCache"), "1")
    || isImmutableSnippet(id);
  
  temp tempSetTL(loadSnippet_publicOnly, true);
  S text = loadSnippet_simpleCache(fsI(id));
  if (empty(contentType)) ret text;
  O response = subBot_serveWithContentType(text, contentType);
  if (maxCache) subBot_maxCacheHeaders(response);
  ret response;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014036
Snippet name: Serve Snippets (botcompany.de/serve/{id})
Eternal ID of this version: #1014036/8
Text MD5: 1c9f132e2534efaa680a5432c8e3c935
Transpilation MD5: acbca9fc36545eb05af45cfc062bc66e
Author: stefan
Category: javax / web
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-24 17:16:45
Source code size: 494 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 576 / 4064
Version history: 7 change(s)
Referenced in: [show references]