使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

i042416發表於2018-05-15

伺服器端的JavaScript, 看下wikipedia的介紹:

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
開啟SAP HANA Web-Based Development Workbench:


使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

建立一個新的package:


使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript
使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

建立一個新的Application:


使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript
使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

建立一個新的檔案test.xsjs, 內容如下:

var userInput = $.request.parameters.get("userStuff");
$.response.contentType = "text/html";
$.response.setBody(userInput); 
使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

這個hello world應用是一個簡單的echo應用:將使用者透過url傳進來的資料直接輸出。
測試:


使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

要獲取更多Jerry的原創技術文章,請關注公眾號"汪子熙"或者掃描下面二維碼:

使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript
使用HANA Web-based Development Workbench建立最簡單的Server Side JavaScript

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2154503/,如需轉載,請註明出處,否則將追究法律責任。

相關文章