web_plsql 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +8 -8
- package/.eslintignore +3 -3
- package/.eslintrc.js +347 -273
- package/CHANGELOG.md +127 -106
- package/LICENSE +21 -21
- package/README.md +165 -164
- package/examples/apex.js +70 -70
- package/examples/credentials.js +22 -22
- package/examples/oracledb_example.js +30 -30
- package/examples/sample.js +101 -84
- package/examples/sql/doc_table.sql +13 -13
- package/examples/sql/install.sql +31 -31
- package/examples/sql/sample.pkb +223 -223
- package/examples/sql/sample.pks +24 -24
- package/examples/sql/uninstall.sql +5 -5
- package/examples/static/sample.css +25 -25
- package/jest.config.js +204 -0
- package/package.json +85 -109
- package/src/cgi.ts +95 -95
- package/src/config.ts +97 -97
- package/src/errorPage.ts +286 -286
- package/src/fileUpload.ts +126 -132
- package/src/index.ts +65 -66
- package/src/page.ts +275 -277
- package/src/procedure.ts +360 -359
- package/src/procedureError.ts +27 -27
- package/src/request.ts +139 -139
- package/src/requestError.ts +19 -19
- package/src/stream.ts +26 -26
- package/src/trace.ts +194 -193
- package/test/.eslintrc.json +5 -5
- package/test/{cgi.ts → __tests__/cgi.ts} +96 -95
- package/test/{config.ts → __tests__/config.ts} +41 -41
- package/test/__tests__/errorPage.ts +101 -0
- package/test/{oracledb_mock.ts → __tests__/oracledb_mock.ts} +98 -98
- package/test/{server.ts → __tests__/server.ts} +495 -498
- package/test/{stream.ts → __tests__/stream.ts} +21 -21
- package/test/mock/oracledb.ts +85 -85
- package/test/static/static.html +1 -1
- package/tsconfig.json +24 -23
- package/tsconfig.src.json +23 -22
- package/test/errorPage.ts +0 -101
- package/test/mocha.opts +0 -7
- package/tsconfig.test.json +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,106 +1,127 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
|
-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
###
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Fixed
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [?.?.?] - 2021-??-??
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
### Changed
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [0.5.0] - 2022-05-09
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Replaced mocha with jest.
|
|
19
|
+
- Added support for node 18.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Updated all dependencies.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.4.2] - 2022-01-17
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- node.js support starting with v16.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- Updated all dependencies.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## [0.4.1] - 2021-08-30
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
- Updated all dependencies.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## [0.4.0] - 2021-04-09
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Added a simple oracledb example "examples/oracledb_example.js".
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- The credentials for the "examples/sample.js" are stored in "examples/credentials.js" and can also be set using the environment.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- Updated to oracledb 5 and full binary support for node 14 and later.
|
|
50
|
+
- Updated all minor dependencies.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## [0.3.2] - 2020-03-29
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
- Updated all minor dependencies.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## [0.3.1] - 2020-02-19
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
- Updated all minor dependencies.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [0.2.0] - 2019-06-02
|
|
66
|
+
|
|
67
|
+
## [0.2.0] - 2019-06-02
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
- Fixed a problem with the dependencies when installing the npm package.
|
|
71
|
+
- Fixed link to the official oracledb installation documentation.
|
|
72
|
+
- Updated all dependencies.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## [0.1.2] - 2019-03-02
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
- Updated all dependencies.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## [0.1.1] - 2019-02-05
|
|
82
|
+
|
|
83
|
+
### Changed
|
|
84
|
+
- Migrated from Babel to TypeScript
|
|
85
|
+
|
|
86
|
+
### Fixed
|
|
87
|
+
- Updated all dependencies.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [0.1.0] - 2018-09-03
|
|
91
|
+
|
|
92
|
+
### Added
|
|
93
|
+
- Added the configuration open "errorStyle" that can be set to "basic" or "debug".
|
|
94
|
+
- The current web_plsql version is now a string property "version" in the middleware object.
|
|
95
|
+
- Added the express status monitor to the sample. (http://localhost:8000/status)
|
|
96
|
+
|
|
97
|
+
### Fixed
|
|
98
|
+
- When downloading a file, first send any eventual "other headers" like "Content-Disposition".
|
|
99
|
+
- Changed x-db-xontent-length to x-db-content-length.
|
|
100
|
+
- Updated all dependencies.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## [0.0.3] - 2018-03-20
|
|
104
|
+
|
|
105
|
+
### Added
|
|
106
|
+
- Added support for the PlsqlPathAlias and PlsqlPathAliasProcedure DAD settings.
|
|
107
|
+
- Partial support of APEX application.
|
|
108
|
+
- Added example configuration for APEX application.
|
|
109
|
+
- Added unit tests with a code coverage of over 90%.
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
- Fixed some edge cases when processing the http headers.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## [0.0.2] - 2018-03-19
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
- Allow to add or override CGI environment variables using the "cgi" property in the configuration object.
|
|
119
|
+
- Added unit tests with a code coverage of over 80%.
|
|
120
|
+
|
|
121
|
+
### Fixed
|
|
122
|
+
- Fixed wrong field name when uploading files using a form.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
## [0.0.1] - 2018-03-17
|
|
126
|
+
|
|
127
|
+
- Initial release
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(The MIT License)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2018 Dieter Oberkofler <dieter.oberkofler@gmail.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2018 Dieter Oberkofler <dieter.oberkofler@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,164 +1,165 @@
|
|
|
1
|
-
[![NPM Version][npm-image]][npm-url]
|
|
2
|
-
[![NPM Downloads][downloads-image]][downloads-url]
|
|
3
|
-
[](https://travis-ci.org/doberkofler/web_plsql)
|
|
4
|
-
[![Build status][appveyor-image]][appveyor-url]
|
|
5
|
-
[](https://coveralls.io/github/doberkofler/web_plsql?branch=master)
|
|
6
|
-
|
|
7
|
-
# Oracle PL/SQL Gateway Middleware for the Express web framework for Node.js
|
|
8
|
-
This Express Middleware is a bridge between a PL/SQL application running in an Oracle Database and an Express web server for Node.js.
|
|
9
|
-
It is an open-source alternative to mod_plsql, the Embedded PL/SQL Gateway and ORDS,
|
|
10
|
-
allowing you to develop PL/SQL web applications using the PL/SQL Web Toolkit (OWA) and Oracle Application Express (Apex),
|
|
11
|
-
and serve the content using the Express web framework for Node.js.
|
|
12
|
-
|
|
13
|
-
Please feel free to try and suggest any improvements. Your thoughts and ideas are most welcome.
|
|
14
|
-
|
|
15
|
-
# Release History
|
|
16
|
-
See the [changelog](https://github.com/doberkofler/web_plsql/blob/master/CHANGELOG.md).
|
|
17
|
-
|
|
18
|
-
# Installation
|
|
19
|
-
|
|
20
|
-
## Prerequisites
|
|
21
|
-
There are several prerequisites needed to both compile and run the Oracle database driver.
|
|
22
|
-
Please visit the [node-oracledb INSTALL.md](https://oracle.github.io/node-oracledb/INSTALL.html) page for more information.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
* Create
|
|
27
|
-
*
|
|
28
|
-
* Install
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
app.use(
|
|
103
|
-
app.use(bodyParser.
|
|
104
|
-
app.use(
|
|
105
|
-
app.use(
|
|
106
|
-
app.use(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
[npm-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
[downloads-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
[appveyor-
|
|
1
|
+
[![NPM Version][npm-image]][npm-url]
|
|
2
|
+
[![NPM Downloads][downloads-image]][downloads-url]
|
|
3
|
+
[](https://travis-ci.org/doberkofler/web_plsql)
|
|
4
|
+
[![Build status][appveyor-image]][appveyor-url]
|
|
5
|
+
[](https://coveralls.io/github/doberkofler/web_plsql?branch=master)
|
|
6
|
+
|
|
7
|
+
# Oracle PL/SQL Gateway Middleware for the Express web framework for Node.js
|
|
8
|
+
This Express Middleware is a bridge between a PL/SQL application running in an Oracle Database and an Express web server for Node.js.
|
|
9
|
+
It is an open-source alternative to mod_plsql, the Embedded PL/SQL Gateway and ORDS,
|
|
10
|
+
allowing you to develop PL/SQL web applications using the PL/SQL Web Toolkit (OWA) and Oracle Application Express (Apex),
|
|
11
|
+
and serve the content using the Express web framework for Node.js.
|
|
12
|
+
|
|
13
|
+
Please feel free to try and suggest any improvements. Your thoughts and ideas are most welcome.
|
|
14
|
+
|
|
15
|
+
# Release History
|
|
16
|
+
See the [changelog](https://github.com/doberkofler/web_plsql/blob/master/CHANGELOG.md).
|
|
17
|
+
|
|
18
|
+
# Installation
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
There are several prerequisites needed to both compile and run the Oracle database driver.
|
|
22
|
+
Please visit the [node-oracledb INSTALL.md](https://oracle.github.io/node-oracledb/INSTALL.html) page for more information.
|
|
23
|
+
On where Oracle is looking for the client consult: https://oracle.github.io/node-oracledb/doc/api.html#oracleclientloading
|
|
24
|
+
|
|
25
|
+
## Installing
|
|
26
|
+
* Create and move to a new directory
|
|
27
|
+
* Create a new npm project (`npm init`)
|
|
28
|
+
* Install package (`npm install web_plsql`)
|
|
29
|
+
* Install the PL/SQL examples (`sqlplus node_modules/web_plsql/examples/sql/install.sql`)
|
|
30
|
+
* Start the sample server (`node node_modules/web_plsql/examples/sample`)
|
|
31
|
+
* Invoke a browser and open the page `http://localhost:8000/base`
|
|
32
|
+
|
|
33
|
+
# Configuration
|
|
34
|
+
|
|
35
|
+
## How does a mod_plsql DAD configuration compare to the web_plsql app
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
<Location /pls/sample>
|
|
39
|
+
SetHandler pls_handler
|
|
40
|
+
Order deny,allow
|
|
41
|
+
Allow from all
|
|
42
|
+
PlsqlDatabaseUsername sample
|
|
43
|
+
PlsqlDatabasePassword sample
|
|
44
|
+
PlsqlDatabaseConnectString ORCL
|
|
45
|
+
PlsqlAuthenticationMode Basic
|
|
46
|
+
PlsqlDefaultPage sample.pageindex
|
|
47
|
+
PlsqlDocumentTablename doctable
|
|
48
|
+
PlsqlErrorStyle DebugStyle
|
|
49
|
+
PlsqlNlsLanguage AMERICAN_AMERICA.UTF8
|
|
50
|
+
</Location>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
const fs = require('fs');
|
|
55
|
+
const path = require('path');
|
|
56
|
+
const express = require('express');
|
|
57
|
+
const bodyParser = require('body-parser');
|
|
58
|
+
const multipart = require('connect-multiparty');
|
|
59
|
+
const cookieParser = require('cookie-parser');
|
|
60
|
+
const compression = require('compression');
|
|
61
|
+
const morgan = require('morgan');
|
|
62
|
+
|
|
63
|
+
const oracledb = require('oracledb');
|
|
64
|
+
const webplsql = require('../lib');
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* Allocate the Oracle database pool
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
const databasePool = oracledb.createPool({
|
|
71
|
+
user: 'sample',
|
|
72
|
+
password: 'sample',
|
|
73
|
+
connectString: 'ORCL',
|
|
74
|
+
poolMin: 10,
|
|
75
|
+
poolMax: 1000,
|
|
76
|
+
poolIncrement: 10,
|
|
77
|
+
queueRequests: false,
|
|
78
|
+
queueTimeout: 1000
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
databasePool.catch(e => {
|
|
82
|
+
console.error(`Unable to create database pool.\n${e.message}`);
|
|
83
|
+
process.exit(1);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
* Start the server
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
const PORT = 8000;
|
|
91
|
+
const PATH = '/pls/sample';
|
|
92
|
+
const OPTIONS = {
|
|
93
|
+
defaultPage: 'sample.pageIndex',
|
|
94
|
+
doctable: 'docTable',
|
|
95
|
+
errorStyle: 'debug'
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// create express app
|
|
99
|
+
const app = express();
|
|
100
|
+
|
|
101
|
+
// add middleware
|
|
102
|
+
app.use(multipart());
|
|
103
|
+
app.use(bodyParser.json());
|
|
104
|
+
app.use(bodyParser.urlencoded({extended: true}));
|
|
105
|
+
app.use(cookieParser());
|
|
106
|
+
app.use(compression());
|
|
107
|
+
app.use(morgan('combined', {stream: fs.createWriteStream(path.join(process.cwd(), 'access.log'), {flags: 'a'})}));
|
|
108
|
+
|
|
109
|
+
// add the oracle pl/sql express middleware
|
|
110
|
+
app.use(PATH + '/:name?', webplsql(databasePool, OPTIONS));
|
|
111
|
+
|
|
112
|
+
// serving static files
|
|
113
|
+
app.use('/static', express.static(path.join(process.cwd(), 'examples/static')));
|
|
114
|
+
|
|
115
|
+
// listen on port
|
|
116
|
+
console.log(`Waiting on http://localhost:${PORT}${PATH}`);
|
|
117
|
+
app.listen(PORT);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
# Missing features
|
|
121
|
+
|
|
122
|
+
## Features in mod_plsql that are not (yet) available in web_plsql:
|
|
123
|
+
- Support for APEX 5.
|
|
124
|
+
- Default exclusion list.
|
|
125
|
+
- Basic and custom authentication methods, based on the OWA_SEC package and custom packages.
|
|
126
|
+
|
|
127
|
+
## Supported mod_plsql configuration options:
|
|
128
|
+
- PlsqlDatabaseConnectString -> specified when creating the oracledb connection pool
|
|
129
|
+
- PlsqlDatabaseUserName -> specified when creating the oracledb connection pool
|
|
130
|
+
- PlsqlDatabasePassword -> specified when creating the oracledb connection pool
|
|
131
|
+
- PlsqlDefaultPage -> use the "doctable" configuration option
|
|
132
|
+
- PlsqlDocumentTablename -> use the "defaultPage" configuration option
|
|
133
|
+
- PlsqlErrorStyle -> use the "errorStyle" configuration option
|
|
134
|
+
- PlsqlLogEnable -> use a HTTP request logger middleware for node.js like morgan
|
|
135
|
+
- PlsqlLogDirectory -> use a HTTP request logger middleware for node.js like morgan
|
|
136
|
+
- PlsqlPathAlias -> use the "pathAlias.alias" configuration option
|
|
137
|
+
- PlsqlPathAliasProcedure -> use the "pathAlias.procedure" configuration option
|
|
138
|
+
|
|
139
|
+
## Configuration options that are not (yet) supported:
|
|
140
|
+
- PlsqlIdleSessionCleanupInterval
|
|
141
|
+
- PlsqlAfterProcedure
|
|
142
|
+
- PlsqlAlwaysDescribeProcedure
|
|
143
|
+
- PlsqlBeforeProcedure
|
|
144
|
+
- PlsqlCGIEnvironmentList
|
|
145
|
+
- PlsqlDocumentPath
|
|
146
|
+
- PlsqlDocumentProcedure
|
|
147
|
+
- PlsqlExclusionList
|
|
148
|
+
- PlsqlRequestValidationFunction
|
|
149
|
+
- PlsqlSessionCookieName
|
|
150
|
+
- PlsqlSessionStateManagement
|
|
151
|
+
- PlsqlTransferMode
|
|
152
|
+
|
|
153
|
+
# License
|
|
154
|
+
|
|
155
|
+
[MIT](LICENSE)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
[npm-image]: https://img.shields.io/npm/v/web_plsql.svg
|
|
159
|
+
[npm-url]: https://npmjs.org/package/web_plsql
|
|
160
|
+
|
|
161
|
+
[downloads-image]: https://img.shields.io/npm/dm/web_plsql.svg
|
|
162
|
+
[downloads-url]: https://npmjs.org/package/web_plsql
|
|
163
|
+
|
|
164
|
+
[appveyor-image]: https://ci.appveyor.com/api/projects/status/github/doberkofler/web_plsql?branch=master&svg=true
|
|
165
|
+
[appveyor-url]: https://ci.appveyor.com/project/doberkofler/web-plsql
|