@moneypot/hub 0.0.3 → 1.0.1
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/README.md +33 -8
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @moneypot/hub
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
@moneypot/hub is our official game server that integrates with any number of Moneypot casinos.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Extend it with custom tables and game logic.
|
|
6
|
+
- Give it an api key for each controller you've registered on each casino.
|
|
7
|
+
- It will automatically sync users, their balances, deposits, and withdrawals.
|
|
6
8
|
|
|
7
9
|
Example implementations:
|
|
8
10
|
|
|
@@ -22,20 +24,33 @@ $ npm install @moneypot/hub
|
|
|
22
24
|
## Usage
|
|
23
25
|
|
|
24
26
|
```typescript
|
|
25
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
type ServerOptions,
|
|
29
|
+
defaultPlugins,
|
|
30
|
+
startAndListen,
|
|
31
|
+
} from "@moneypot/hub";
|
|
26
32
|
import path from "path";
|
|
27
33
|
|
|
28
34
|
const options: ServerOptions = {
|
|
29
|
-
//
|
|
35
|
+
// PostgreSQL schemas to expose to the GraphQL API
|
|
36
|
+
// This allows your application-specific tables to be accessible through GraphQL
|
|
30
37
|
extraPgSchemas: ["app"],
|
|
38
|
+
|
|
31
39
|
plugins: [
|
|
40
|
+
// These are required for the hub server to function
|
|
32
41
|
...defaultPlugins,
|
|
33
|
-
//
|
|
42
|
+
// Add your custom plugins here to extend server functionality
|
|
34
43
|
],
|
|
35
|
-
|
|
44
|
+
|
|
45
|
+
// File path where the generated GraphQL schema definition will be saved
|
|
36
46
|
exportSchemaSDLPath: path.join(import.meta.dirname, "../schema.graphql"),
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
|
|
48
|
+
// Optional: Directory containing migration files for your database
|
|
49
|
+
// When enabled, the server will automatically apply pending migrations on startup
|
|
50
|
+
userDatabaseMigrationsPath: path.join(
|
|
51
|
+
import.meta.dirname,
|
|
52
|
+
"../automigrations"
|
|
53
|
+
),
|
|
39
54
|
};
|
|
40
55
|
|
|
41
56
|
startAndListen(options)
|
|
@@ -44,3 +59,13 @@ startAndListen(options)
|
|
|
44
59
|
})
|
|
45
60
|
.catch(console.error);
|
|
46
61
|
```
|
|
62
|
+
|
|
63
|
+
## Dashboard
|
|
64
|
+
|
|
65
|
+
When the server is running, visit its admin dashboard at the `/dashboard` route.
|
|
66
|
+
|
|
67
|
+
You'll need an api key from your hub database:
|
|
68
|
+
|
|
69
|
+
```sql
|
|
70
|
+
insert into hub.api_key default values returning key;
|
|
71
|
+
```
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneypot/hub",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"author": "moneypot.com",
|
|
5
|
+
"homepage": "https://moneypot.com/hub",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"moneypot"
|
|
8
|
+
],
|
|
9
|
+
"description": "Official MoneyPot hub server",
|
|
7
10
|
"type": "module",
|
|
8
11
|
"main": "dist/src/index.js",
|
|
9
12
|
"types": "dist/src/index.d.ts",
|