-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathobjectstack.config.ts
More file actions
58 lines (53 loc) · 2.36 KB
/
objectstack.config.ts
File metadata and controls
58 lines (53 loc) · 2.36 KB
1
2
3
4
5
6
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
49
50
51
52
53
54
55
56
57
58
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
/**
* ObjectStack Server — Host Configuration (runtime node)
*
* Booted by `objectstack dev` / `objectstack serve` (see `package.json`).
*
* ## Boot modes
*
* Default: single-project **local** mode. `pnpm dev` runs a self-contained
* server with one control DB on disk and Studio UI in single-project mode
* (no org/project picker — platform metadata only).
*
* Override via env:
* - `OBJECTSTACK_CLOUD_URL=http://localhost:4000` — connect to a
* locally-running `apps/cloud` (multi-project control plane).
* - `OBJECTSTACK_CLOUD_URL=https://cloud.objectstack.ai` — hosted
* control plane.
* - `OBJECTSTACK_MODE=cloud` — boot the
* multi-project control plane in this very process (lives in
* `apps/cloud`).
*
* All boot orchestration lives in `@objectstack/service-cloud`. This file
* only supplies the apps/server-specific knobs (filesystem app bundle
* resolution).
*/
import { resolve as resolvePath, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { createBootStack } from '@objectstack/service-cloud';
import { createFsAppBundleResolver } from './server/fs-app-bundle-resolver.js';
const serverDir = dirname(fileURLToPath(import.meta.url));
const dataDir = resolvePath(serverDir, '.objectstack/data');
const localArtifactPath = process.env.OBJECTSTACK_ARTIFACT_PATH
?? resolvePath(serverDir, 'dist/objectstack.json');
const config = await createBootStack({
runtime: {
dataDir,
artifactPath: localArtifactPath,
appBundles: createFsAppBundleResolver(),
// Default to single-project local mode (`cloudUrl: 'local'`) so
// `pnpm dev` boots a self-contained server: one project, one
// control DB on disk, Studio UI in single-project mode (no
// org/project picker — platform metadata only).
//
// Override with:
// - `OBJECTSTACK_CLOUD_URL=http://localhost:4000` to connect to
// a locally-running `apps/cloud` (multi-project control plane)
// - `OBJECTSTACK_CLOUD_URL=https://cloud.objectstack.ai` for the
// hosted control plane
cloudUrl: process.env.OBJECTSTACK_CLOUD_URL ?? 'local',
cloudApiKey: process.env.OBJECTSTACK_CLOUD_API_KEY,
},
});
export default config;