You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/runtime/server.ts
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ const contentTypes = {
32
32
}
33
33
34
34
constBROWSER=!argv["server"];
35
-
constPORT=process.env.PORT||8080;
35
+
constPORT=process.env.PORT||argv["port"]||8080;
36
36
constserverDatabase=newServerDatabase();
37
37
constshared=newPersistedDatabase();
38
38
@@ -163,5 +163,13 @@ let wss = new WebSocketServer({server: server});
163
163
initWebsocket(wss);
164
164
165
165
server.listen(PORT,function(){
166
-
console.log("Server listening on: http://localhost:%s",PORT);
166
+
console.log(`Eve is available at http://localhost:${PORT}. Point your browser there to access the Eve editor.`);
167
+
});
168
+
169
+
// If the port is already in use, display an error message
170
+
process.on('uncaughtException',function(err){
171
+
if(err.errno==='EADDRINUSE'){
172
+
console.log(`ERROR: Eve couldn't start because port ${PORT} is already in use.\n\nYou can select a different port for Eve using the "port" argument.\nFor example:\n\n> npm start -- --port 1234`);
0 commit comments