web_plsql
The Express Middleware for Oracle PL/SQL
Last updated 2 months ago by doberkofler .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install web_plsql 
SYNC missed versions from official npm registry.

NPM Version NPM Downloads Linux Build Build status Coverage Status

Oracle PL/SQL Gateway Middleware for the Express web framework for Node.js

This Express Middleware is a bridge between a PL/SQL application running in an Oracle Database and an Express web server for Node.js. It is an open-source alternative to mod_plsql, the Embedded PL/SQL Gateway and ORDS, allowing you to develop PL/SQL web applications using the PL/SQL Web Toolkit (OWA) and Oracle Application Express (Apex), and serve the content using the Express web framework for Node.js.

Please feel free to try and suggest any improvements. Your thoughts and ideas are most welcome.

Release History

See the changelog.

Installation

Prerequisites

There are several prerequisites needed to both compile and run the Oracle database driver. Please visit the node-oracledb INSTALL.md page for more information.

Installing

  • Create and move to a new directory
  • Create a new npm project (npm init)
  • Install package (npm install web_plsql)
  • Install the PL/SQL examples (sqlplus node_modules/web_plsql/examples/sql/install.sql)
  • Start the sample server (node node_modules/web_plsql/examples/sample)
  • Invoke a browser and open the page http://localhost:8000/base

Configuration

How does a mod_plsql DAD configuration compare to the web_plsql app

<Location /pls/sample>
  SetHandler                    pls_handler
  Order                         deny,allow
  Allow                         from all
  PlsqlDatabaseUsername         sample
  PlsqlDatabasePassword         sample
  PlsqlDatabaseConnectString    ORCL
  PlsqlAuthenticationMode       Basic
  PlsqlDefaultPage              sample.pageindex
  PlsqlDocumentTablename        doctable
  PlsqlErrorStyle               DebugStyle
  PlsqlNlsLanguage              AMERICAN_AMERICA.UTF8
</Location>
const fs = require('fs');
const path = require('path');
const express = require('express');
const bodyParser = require('body-parser');
const multipart = require('connect-multiparty');
const cookieParser = require('cookie-parser');
const compression = require('compression');
const morgan = require('morgan');

const oracledb = require('oracledb');
const webplsql = require('../lib');

/*
*	Allocate the Oracle database pool
*/

const databasePool = oracledb.createPool({
	user: 'sample',
	password: 'sample',
	connectString: 'ORCL',
	poolMin: 10,
	poolMax: 1000,
	poolIncrement: 10,
	queueRequests: false,
	queueTimeout: 1000
});

databasePool.catch(e => {
	console.error(`Unable to create database pool.\n${e.message}`);
	process.exit(1);
});

/*
*	Start the server
*/

const PORT = 8000;
const PATH = '/pls/sample';
const OPTIONS = {
	defaultPage: 'sample.pageIndex',
  doctable: 'docTable',
  errorStyle: 'debug'
};

// create express app
const app = express();

// add middleware
app.use(multipart());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use(cookieParser());
app.use(compression());
app.use(morgan('combined', {stream: fs.createWriteStream(path.join(process.cwd(), 'access.log'), {flags: 'a'})}));

// add the oracle pl/sql express middleware
app.use(PATH + '/:name?', webplsql(databasePool, OPTIONS));

// serving static files
app.use('/static', express.static(path.join(process.cwd(), 'examples/static')));

// listen on port
console.log(`Waiting on http://localhost:${PORT}${PATH}`);
app.listen(PORT);

Missing features

Features in mod_plsql that are not (yet) available in web_plsql:

  • Support for APEX 5.
  • Default exclusion list.
  • Basic and custom authentication methods, based on the OWA_SEC package and custom packages.

Supported mod_plsql configuration options:

  • PlsqlDatabaseConnectString -> specified when creating the oracledb connection pool
  • PlsqlDatabaseUserName -> specified when creating the oracledb connection pool
  • PlsqlDatabasePassword -> specified when creating the oracledb connection pool
  • PlsqlDefaultPage -> use the "doctable" configuration option
  • PlsqlDocumentTablename -> use the "defaultPage" configuration option
  • PlsqlErrorStyle -> use the "errorStyle" configuration option
  • PlsqlLogEnable -> use a HTTP request logger middleware for node.js like morgan
  • PlsqlLogDirectory -> use a HTTP request logger middleware for node.js like morgan
  • PlsqlPathAlias -> use the "pathAlias.alias" configuration option
  • PlsqlPathAliasProcedure -> use the "pathAlias.procedure" configuration option

Configuration options that are not (yet) supported:

  • PlsqlIdleSessionCleanupInterval
  • PlsqlAfterProcedure
  • PlsqlAlwaysDescribeProcedure
  • PlsqlBeforeProcedure
  • PlsqlCGIEnvironmentList
  • PlsqlDocumentPath
  • PlsqlDocumentProcedure
  • PlsqlExclusionList
  • PlsqlRequestValidationFunction
  • PlsqlSessionCookieName
  • PlsqlSessionStateManagement
  • PlsqlTransferMode

License

MIT

Current Tags

  • 0.3.2                                ...           latest (2 months ago)

10 Versions

  • 0.3.2                                ...           2 months ago
  • 0.3.1                                ...           3 months ago
  • 0.3.0                                ...           8 months ago
  • 0.2.0                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 0
Last Month 1
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |