@niledatabase/server 2.1.1 → 2.1.2-alpha.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/README.md
CHANGED
|
@@ -36,7 +36,7 @@ await nile.api.createTenant({ name: 'name' });
|
|
|
36
36
|
await nile.db.query('select * from todo');
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Auto-configuration
|
|
40
40
|
|
|
41
41
|
In addition to `user` and `password`, a fully configured SDK must also have values for `db.host`, `databaseName`, and `databaseId`. If the values are not provided in either the `.env` file or the instance configuration, the SDK will automatically phone home to configure itself. For production, it is recommended to set those values.
|
|
42
42
|
|
|
@@ -53,6 +53,7 @@ Configuration passed to `Server` takes precedence over `.env` vars.
|
|
|
53
53
|
| tenantId | `string` | NILEDB_TENANT | ID of the tenant associated. |
|
|
54
54
|
| userId | `string` | | ID of the user associated. |
|
|
55
55
|
| db | `PoolConfig` | | Configuration object for [pg.Pool](https://node-postgres.com/apis/pool). |
|
|
56
|
+
| db.host | `string` | NILEDB_HOST | Base host for DB. Defaut is `db.thenile.dev` |
|
|
56
57
|
| api | `object` | | Configuration object for API settings. |
|
|
57
58
|
| api.basePath | `string` | NILEDB_API | Base host for API for a specific region. Default is `api.thenile.dev`. |
|
|
58
59
|
| api.cookieKey | `string` | | Key for API cookie. Default is `token`. |
|
package/dist/Server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Pool } from 'pg';
|
|
2
|
-
import {
|
|
2
|
+
import { ServerConfig } from './types';
|
|
3
3
|
import { Config } from './utils/Config';
|
|
4
4
|
import Auth from './auth';
|
|
5
5
|
import Users from './users';
|
|
@@ -29,7 +29,7 @@ declare class Server {
|
|
|
29
29
|
* returns the global Server object, an existing server that's already been configured,
|
|
30
30
|
* or a new one if the config isn't in the cache
|
|
31
31
|
*/
|
|
32
|
-
getInstance(config:
|
|
32
|
+
getInstance(config: ServerConfig): Server;
|
|
33
33
|
}
|
|
34
34
|
export default function Nile(config?: ServerConfig): Server;
|
|
35
35
|
export {};
|