Processing User Input

node v10.23.3
version: 1.0.0
endpointsharetweet
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>"
Loading…

no comments

    sign in to comment