mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 06:42:03 +00:00
feat: enhance port management and server initialization process
- Added a new function to check if a port is in use without terminating processes, improving user experience during server startup. - Updated the health check function to accept a dynamic port parameter, allowing for flexible server configurations. - Implemented user prompts for handling port conflicts, enabling users to kill processes, choose different ports, or cancel the operation. - Enhanced CORS configuration to support localhost and IPv6 addresses, ensuring compatibility across different development environments. - Refactored the main function to utilize dynamic port assignments for both the web and server applications, improving overall flexibility.
This commit is contained in:
@@ -133,7 +133,11 @@ app.use(
|
||||
}
|
||||
|
||||
// For local development, allow localhost origins
|
||||
if (origin.startsWith('http://localhost:') || origin.startsWith('http://127.0.0.1:')) {
|
||||
if (
|
||||
origin.startsWith('http://localhost:') ||
|
||||
origin.startsWith('http://127.0.0.1:') ||
|
||||
origin.startsWith('http://[::1]:')
|
||||
) {
|
||||
callback(null, origin);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user