DATA_DIR
This commit is contained in:
parent
d6ae39ac15
commit
a1aa37297f
|
|
@ -48,6 +48,7 @@ export default app.defaults
|
||||||
|
|
||||||
- `PORT` - your assigned port (3001-3100)
|
- `PORT` - your assigned port (3001-3100)
|
||||||
- `APPS_DIR` - path to `/apps` directory
|
- `APPS_DIR` - path to `/apps` directory
|
||||||
|
- `DATA_DIR` - per-app data directory (`toes/<app-name>/`)
|
||||||
|
|
||||||
## health checks
|
## health checks
|
||||||
|
|
||||||
|
|
|
||||||
10
docs/ENV.md
10
docs/ENV.md
|
|
@ -39,3 +39,13 @@ DEBUG=true
|
||||||
```
|
```
|
||||||
|
|
||||||
Keys are uppercased automatically. Quotes around values are stripped.
|
Keys are uppercased automatically. Quotes around values are stripped.
|
||||||
|
|
||||||
|
## Built-in variables
|
||||||
|
|
||||||
|
These are set automatically by Toes — you don't need to configure them:
|
||||||
|
|
||||||
|
- `PORT` - assigned port (3001-3100)
|
||||||
|
- `APPS_DIR` - path to the `/apps` directory
|
||||||
|
- `DATA_DIR` - per-app data directory (`toes/<app-name>/`) for storing persistent data
|
||||||
|
- `TOES_URL` - base URL of the Toes server
|
||||||
|
- `TOES_DIR` - path to the toes config directory
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,20 @@ app.get('/', c => {
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## environment
|
||||||
|
|
||||||
|
- `PORT` - your assigned port
|
||||||
|
- `APPS_DIR` - path to `/apps` directory
|
||||||
|
- `DATA_DIR` - per-app data directory (`toes/<tool-name>/`)
|
||||||
|
- `TOES_URL` - base URL of the Toes server
|
||||||
|
- `TOES_DIR` - path to the toes config directory
|
||||||
|
|
||||||
## accessing app files
|
## accessing app files
|
||||||
|
|
||||||
Always go through the `current` symlink:
|
Always go through the `current` symlink:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const APPS_DIR = process.env.APPS_DIR ?? '.'
|
const APPS_DIR = process.env.APPS_DIR!
|
||||||
const appPath = join(APPS_DIR, appName, 'current')
|
const appPath = join(APPS_DIR, appName, 'current')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -597,7 +597,7 @@ async function runApp(dir: string, port: number) {
|
||||||
|
|
||||||
const proc = Bun.spawn(['bun', 'run', 'toes'], {
|
const proc = Bun.spawn(['bun', 'run', 'toes'], {
|
||||||
cwd,
|
cwd,
|
||||||
env: { ...process.env, ...appEnv, PORT: String(port), NO_AUTOPORT: 'true', APPS_DIR, TOES_DIR, TOES_URL },
|
env: { ...process.env, ...appEnv, PORT: String(port), NO_AUTOPORT: 'true', APPS_DIR, DATA_DIR: join(process.env.DATA_DIR ?? '.', 'toes', dir), TOES_DIR, TOES_URL },
|
||||||
stdout: 'pipe',
|
stdout: 'pipe',
|
||||||
stderr: 'pipe',
|
stderr: 'pipe',
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user