Files
shumai/packages/api/src/index.ts
T

23 lines
566 B
TypeScript
Raw Normal View History

import { loadEnvConfig } from '@shumai/core/src/env-loader'
2026-05-19 16:05:09 +08:00
loadEnvConfig(process.cwd(), process.env.NODE_ENV !== 'production')
const command = process.argv[2]
if (command === 'worker') {
const { run } = await import('./worker')
2026-05-19 16:05:09 +08:00
run().catch((err) => {
console.error(err)
process.exit(1)
})
} else {
// Default or 'serve' command
const { run } = await import('./serve')
2026-05-19 16:05:09 +08:00
run().catch((err) => {
console.error(err)
process.exit(1)
})
}
// Re-export AppType for frontend client.ts usage (type-only)
export type { AppType } from './serve'