伺服器端的JavaScript, 看下wikipedia的介紹: https://en.wikipedia.org/wiki/JavaScript#Server-side_JavaScript Server-side JavaScript
In December 1995, soon after releasing JavaScript for browsers, Netscape introduced an implementation of the language for server-side scripting with Netscape Enterprise Server.
Since 1996, the IIS web-server has supported Microsoft's implementation of server-side Javascript -- JScript -- in ASP and .NET pages.
Since the mid-2000s, additional server-side JavaScript implementations have been introduced, such as Node.js in 2009.
再看SAP的Server Side(伺服器端) JavaScript解決方案:SAP Extended Application Service
建立一個新的package:
建立一個新的Application:
建立一個新的檔案test.xsjs, 内容如下:
var userInput = $.request.parameters.get("userStuff");
$.response.contentType = "text/html";
$.response.setBody(userInput);
這個hello world應用是一個簡單的echo應用:将使用者通過url傳進來的資料直接輸出。
測試:
本文來自雲栖社群合作夥伴“汪子熙”,了解相關資訊可以關注微信公衆号"汪子熙"。