web_plsql
0.5.0
هذا الوسيطة السريعة عبارة عن جسر بين تطبيق PL/SQL الذي يعمل في قاعدة بيانات Oracle وخادم ويب Express لـ Node.js. إنه بديل مفتوح المصدر لـ MOD_PLSQL ، بوابة PL/SQL المدمجة و ORDS ، مما يتيح لك تطوير تطبيقات الويب PL/SQL باستخدام مجموعة أدوات الويب PL/SQL (OWA) و Oracle Application Express (APEX) ، وتقديم المحتوى باستخدام إطار الويب السريع لـ Node.JS.
لا تتردد في محاولة اقتراح أي تحسينات. أفكارك وأفكارك موضع ترحيب كبير.
انظر changelog.
هناك العديد من المتطلبات الأساسية اللازمة لتجميع وتشغيل برنامج تشغيل قاعدة بيانات Oracle. يرجى زيارة صفحة install.md node-oracledb لمزيد من المعلومات. حول المكان الذي تبحث فيه Oracle عن استشارة العميل: https://oracle.github.io/node-oracledb/doc/api.html#oraclientloading
npm init )npm install web_plsql )sqlplus node_modules/web_plsql/examples/sql/install.sql )node node_modules/web_plsql/examples/sample )http://localhost:8000/base <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 ) ;معهد ماساتشوستس للتكنولوجيا