Skip to content

Commit a7d01dc

Browse files
committed
update
1 parent 914c68e commit a7d01dc

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

workbench/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": "astro build",
1111
"preview": "astro preview",
1212
"astro": "astro",
13-
"start": "node scripts/start-pg-world.js && node dist/server/entry.mjs"
13+
"start": "node scripts/start-with-pg.mjs"
1414
},
1515
"dependencies": {
1616
"@astrojs/node": "9.5.0",

workbench/astro/scripts/start-pg-world.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
3+
// Start the Postgres World before starting the Astro server
4+
// Needed since we test this in CI
5+
// Astro doesn't have a hook for starting the Postgres World in production
6+
7+
async function main() {
8+
if (process.env.WORKFLOW_TARGET_WORLD === '@workflow/world-postgres') {
9+
console.log('Starting Postgres World...');
10+
const { getWorld } = await import('workflow/runtime');
11+
await getWorld().start?.();
12+
}
13+
14+
// Now start the Astro server
15+
await import('../dist/server/entry.mjs');
16+
}
17+
18+
main().catch((error) => {
19+
console.error('Failed to start server:', error);
20+
process.exit(1);
21+
});

0 commit comments

Comments
 (0)