欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript Server-Side-JavaScriptJavaScriptHANASAPnodejs 

程序员文章站 2022-07-02 16:00:22
...

服务器端的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
打开SAP HANA Web-Based Development Workbench:

 

 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 

 

创建一个新的package:

 

 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 
 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 

 

创建一个新的Application:

 

 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 
 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 

 

创建一个新的文件test.xsjs, 内容如下:

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

 

这个hello world应用是一个简单的echo应用:将用户通过url传进来的数据直接输出。
测试:

 

 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 

要获取更多Jerry的原创技术文章,请关注公众号"汪子熙"或者扫描下面二维码:

 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs 
 
使用HANA Web-based Development Workbench创建最简单的Server Side JavaScript
            
    
    
        Server-Side-JavaScriptJavaScriptHANASAPnodejs