npgsqlrest 1.1.4 → 1.1.6
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/npgsqlrest.js +21 -0
- package/package.json +2 -2
- package/postinstall.js +1 -1
- package/readme.md +35 -3
package/npgsqlrest.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
// Path to the binary file
|
|
7
|
+
const binaryPath = path.join(__dirname, "./.bin/npgsqlrest");
|
|
8
|
+
|
|
9
|
+
// Arguments passed to the script
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
|
|
12
|
+
// Spawn a child process to run the binary file
|
|
13
|
+
const child = spawn(binaryPath, args, { stdio: "inherit" });
|
|
14
|
+
|
|
15
|
+
child.on("error", (error) => {
|
|
16
|
+
console.error(`Failed to start subprocess.\n${error}`);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
child.on("exit", (code) => {
|
|
20
|
+
process.exit(code);
|
|
21
|
+
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npgsqlrest",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Automatic REST API for PostgreSQL Databases Client Build",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"postinstall": "node postinstall.js",
|
|
7
7
|
"start": "npx npgsqlrest ./appsettings.json ./npgsqlrest.json"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"npgsqlrest": "./
|
|
10
|
+
"npgsqlrest": "./npgsqlrest.js",
|
|
11
11
|
"npgsqlrest-config-copy": "./config-copy.js"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
package/postinstall.js
CHANGED
|
@@ -3,7 +3,7 @@ const path = require("path");
|
|
|
3
3
|
const os = require("os");
|
|
4
4
|
const https = require("https");
|
|
5
5
|
|
|
6
|
-
const downloadDir = "
|
|
6
|
+
const downloadDir = "./.bin/";
|
|
7
7
|
const downloadFrom = "https://github.com/vb-consulting/NpgsqlRest/releases/download/v2.7.1-client-v1.1.0/";
|
|
8
8
|
|
|
9
9
|
function download(url, to, done) {
|
package/readme.md
CHANGED
|
@@ -25,6 +25,14 @@ NpgsqlRest Client Web App is a command line utility that runs as a configurable
|
|
|
25
25
|
|
|
26
26
|
See the [default configuration file](https://vb-consulting.github.io/npgsqlrest/config/) with descriptions for more information.
|
|
27
27
|
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
Install `npgsqlrest` using npm:
|
|
31
|
+
|
|
32
|
+
```console
|
|
33
|
+
npm install npgsqlrest --save-dev
|
|
34
|
+
```
|
|
35
|
+
|
|
28
36
|
## Usage
|
|
29
37
|
|
|
30
38
|
```console
|
|
@@ -44,16 +52,40 @@ Example: npgsqlrest appsettings.json appsettings.D
|
|
|
44
52
|
Example: npgsqlrest appsettings.json -o appsettings.Development.json
|
|
45
53
|
```
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
- Use the `npgsqlrest-config-copy` command to copy the default config to the current directory (or, optionally, directory from the first argument).
|
|
48
56
|
|
|
49
|
-
|
|
57
|
+
```console
|
|
58
|
+
$ npx npgsqlrest-config-copy
|
|
59
|
+
Copied appsettings.json to /home/vbilopav/npgsqlrest-npm-test/appsettings.json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- Running with supplied configuration:
|
|
50
63
|
|
|
51
64
|
```console
|
|
52
|
-
|
|
65
|
+
$ npx npgsqlrest appsettings.json project-config.json
|
|
66
|
+
[11:29:06.551 INF] ----> Starting with configuration(s): ["EnvironmentVariablesConfigurationProvider", "JsonConfigurationProvider for 'appsettings.json' (Required)", "JsonConfigurationProvider for 'project-config.json' (Required)"] [Program]
|
|
67
|
+
[11:29:06.552 INF] Using connection: Host=127.0.0.1;Port=5432;Database=test;Username=postgres;Application Name=MyProject [Program]
|
|
68
|
+
[11:29:06.553 INF] Using Cookie Authentication with scheme Cookies. Cookie expires in 14 days. [Program]
|
|
69
|
+
[11:29:06.553 INF] Using Bearer Token Authentication with scheme BearerToken. Token expires in 1 hours and refresh token expires in 14 days. [Program]
|
|
70
|
+
[11:29:06.560 INF] Serving static files from /home/vbilopav/npgsqlrest-npm-test/wwwroot [Program]
|
|
71
|
+
[11:29:07.083 INF] Created endpoint POST /api/case-return-long-table1 [NpgsqlRest]
|
|
72
|
+
[11:29:07.083 INF] Created HTTP file: /home/vbilopav/npgsqlrest-npm-test/test_public.http [NpgsqlRest.HttpFiles]
|
|
73
|
+
[11:29:07.100 INF] Started in 00:00:00.5527040 [Program]
|
|
74
|
+
[11:29:07.100 INF] Listening on ["http://localhost:5001"] [Program]
|
|
75
|
+
^C
|
|
76
|
+
$
|
|
53
77
|
```
|
|
54
78
|
|
|
55
79
|
## Changelog
|
|
56
80
|
|
|
81
|
+
### 1.1.6
|
|
82
|
+
### 1.1.5
|
|
83
|
+
### 1.1.4
|
|
84
|
+
### 1.1.3
|
|
85
|
+
### 1.1.2
|
|
86
|
+
|
|
87
|
+
Fixing the issue with the local .bin directory.
|
|
88
|
+
|
|
57
89
|
### 1.1.1
|
|
58
90
|
|
|
59
91
|
- Move the download bin directory from share `/node_modules/.bin/` to package local `/node_modules/npgsqlrest/.bin/`
|