var hana = require('@sap/hana-client');
var express = require('express');
const { json } = require('express/lib/response');
const { Result } = require('hdb/lib/protocol');
var app = express();
var conn = hana.createConnection();
var conn_params = {
host : '',
port : '',
uid : '',
pwd : ''
};
app.get('/:tabla', function (req, res) {
var nombreTabla = req.params.tabla;
var resultado = "";
conn.connect(conn_params, function(err) {
if (err) throw err;
conn.exec('select top 10 * from JDBC', function (err, result) {
///if (err) throw err;
resultado = result;
conn.disconnect();
})
});
})
var server = app.listen(8081, function () {
var host = server.address().address
var port = server.address().port
console.log("Example app listening at http://%s:%s", host, port)
})
Comments