think/packages/client/prod-server.js

13 lines
378 B
TypeScript
Raw Normal View History

2022-05-18 21:14:18 +08:00
const { getConfig } = require('@think/config');
const config = getConfig();
const cli = require('next/dist/cli/next-start');
2022-05-21 15:09:20 +08:00
const port = (config.client && config.client.port) || 5001;
2022-05-18 21:14:18 +08:00
try {
2022-05-18 21:36:15 +08:00
cli.nextStart(['-p', port]);
2022-05-18 21:14:18 +08:00
console.log(`[think] 客户端已启动,端口:${port}`);
} catch (err) {
console.log(`[think] 客户端启动失败!${err.message || err}`);
}