sherlock's notebooks

  • Processing User Input - /sherlock/processing-user-input
    Last edited 3 years ago - from: api.new
    const url = require("url"); exports.endpoint = function(request, response) { let body = ""; let {query} = url.parse(request.url, true); if (query && query.data) { // process user input body += `<h1>Data: ${query.data}</h1>`; } body += "<form><input name='data' required /><button>Submit</button></form>"; response.setHeader("Content-Type","text/html"); response.end(body); } // Render endpoint "<iframe src='https://untitled-8aru6fqdkacs.runkit.sh/' style='width:100%;border:none'></iframe>"
  • %00sssdaada - /sherlock/testing123
    Last edited 6 years ago
    exports.endpoint = function(request, response) { response.end("hello " + process.env.TEST_VAR1); }