prostgles-server 2.0.166 → 2.0.167
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/examples/full-example-typescript/index.ts +13 -33
- package/examples/full-example-typescript/package-lock.json +5423 -0
- package/examples/full-example-typescript/package.json +4 -7
- package/examples/full-example-vanilla/index.js +3 -52
- package/examples/full-example-vanilla/package.json +5 -5
- package/examples/server/javascript/index.js +1 -1
- package/examples/server/javascript/package.json +3 -3
- package/examples/server/typescript/index.ts +2 -3
- package/examples/server/typescript/package-lock.json +5406 -0
- package/examples/server/typescript/package.json +3 -4
- package/package.json +1 -1
- package/examples/client/react-typescript/README.md +0 -44
- package/examples/client/react-typescript/package-lock.json +0 -13909
- package/examples/client/react-typescript/package.json +0 -39
- package/examples/client/react-typescript/public/favicon.ico +0 -0
- package/examples/client/react-typescript/public/index.html +0 -43
- package/examples/client/react-typescript/public/logo192.png +0 -0
- package/examples/client/react-typescript/public/logo512.png +0 -0
- package/examples/client/react-typescript/public/manifest.json +0 -25
- package/examples/client/react-typescript/public/robots.txt +0 -3
- package/examples/client/react-typescript/src/App.css +0 -38
- package/examples/client/react-typescript/src/App.test.tsx +0 -9
- package/examples/client/react-typescript/src/App.tsx +0 -26
- package/examples/client/react-typescript/src/index.css +0 -13
- package/examples/client/react-typescript/src/index.tsx +0 -17
- package/examples/client/react-typescript/src/logo.svg +0 -7
- package/examples/client/react-typescript/src/react-app-env.d.ts +0 -1
- package/examples/client/react-typescript/src/serviceWorker.ts +0 -149
- package/examples/client/react-typescript/src/setupTests.ts +0 -5
- package/examples/client/react-typescript/tsconfig.json +0 -25
- package/examples/client/vanilla-js/index.html +0 -21
- package/examples/full-example-react/client/README.md +0 -68
- package/examples/full-example-react/client/package-lock.json +0 -14134
- package/examples/full-example-react/client/package.json +0 -36
- package/examples/full-example-react/client/public/favicon.ico +0 -0
- package/examples/full-example-react/client/public/index.html +0 -43
- package/examples/full-example-react/client/public/logo192.png +0 -0
- package/examples/full-example-react/client/public/logo512.png +0 -0
- package/examples/full-example-react/client/public/manifest.json +0 -25
- package/examples/full-example-react/client/public/robots.txt +0 -3
- package/examples/full-example-react/client/src/App.css +0 -14
- package/examples/full-example-react/client/src/App.js +0 -58
- package/examples/full-example-react/client/src/App.test.js +0 -9
- package/examples/full-example-react/client/src/index.css +0 -13
- package/examples/full-example-react/client/src/index.js +0 -17
- package/examples/full-example-react/client/src/logo.svg +0 -7
- package/examples/full-example-react/client/src/serviceWorker.js +0 -141
- package/examples/full-example-react/client/src/setupTests.js +0 -5
- package/examples/full-example-react/client/src/sssetupProxy.js +0 -6
- package/examples/full-example-react/server/index.js +0 -42
- package/examples/full-example-react/server/init.sql +0 -7
- package/examples/full-example-react/server/package.json +0 -18
- package/examples/full-example-typescript/package copy.json +0 -16
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
var http = require('http').createServer(app);
|
|
5
5
|
var io = require("socket.io")(http);
|
|
6
6
|
http.listen(30009);
|
|
7
|
-
|
|
7
|
+
import prostgles from "prostgles-server"
|
|
8
8
|
|
|
9
9
|
import { DBObj } from "./DBoGenerated";
|
|
10
10
|
|
|
@@ -17,34 +17,26 @@ prostgles({
|
|
|
17
17
|
user: process.env.PRGL_USER,
|
|
18
18
|
password: process.env.PRGL_PWD
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
// application_name: "prostgles_api",
|
|
22
|
-
// max: 100,
|
|
23
|
-
// poolIdleTimeout: 10000
|
|
24
|
-
// },
|
|
20
|
+
|
|
25
21
|
sqlFilePath: path.join(__dirname+'/init.sql'),
|
|
26
22
|
io,
|
|
27
23
|
tsGeneratedTypesDir: path.join(__dirname + '/'),
|
|
28
|
-
publish: (
|
|
29
|
-
// if(!socket || !socket._user.admin && !socket._user.id){
|
|
30
|
-
// return false;
|
|
31
|
-
// }
|
|
32
|
-
|
|
24
|
+
publish: () => {
|
|
33
25
|
|
|
34
26
|
return {
|
|
35
27
|
planes: "*"
|
|
36
28
|
}
|
|
37
29
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
publishMethods: ({ dbo }) => {
|
|
31
|
+
return {
|
|
32
|
+
insertPlanes: async (data) => {
|
|
33
|
+
// let tl = Date.now();
|
|
34
|
+
let res = await (dbo.planes).insert(data);
|
|
35
|
+
// console.log(Date.now() - tl, "ms");
|
|
36
|
+
return res;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
48
40
|
|
|
49
41
|
onReady: async (dbo: DBObj) => {
|
|
50
42
|
|
|
@@ -59,16 +51,4 @@ prostgles({
|
|
|
59
51
|
res.status(404).send('Page not found');
|
|
60
52
|
});
|
|
61
53
|
},
|
|
62
|
-
// onSocketConnect: async ({ socket, dbo }) => {
|
|
63
|
-
// return true;
|
|
64
|
-
// },
|
|
65
|
-
// onSocketDisconnect: async ({ socket, dbo }) => {
|
|
66
|
-
// return true;
|
|
67
|
-
// },
|
|
68
|
-
// auth: {
|
|
69
|
-
// login: (data, { socket, dbo }) => {},
|
|
70
|
-
// register: (data, { socket, dbo }) => {},
|
|
71
|
-
// logout: (data, { socket, dbo }) => {},
|
|
72
|
-
// onChange: (state, { socket, dbo }) => {},
|
|
73
|
-
// },
|
|
74
54
|
});
|