@@ -28,7 +28,6 @@ const fs = require('fs');
28
28
const auth = require ( '../middleware/auth' ) ;
29
29
const { osclink } = require ( '../util/strutil' ) ;
30
30
const { surrounding_box, es_import_promise } = require ( '../fun/dev-console-ui-utils' ) ;
31
- const auth2 = require ( '../middleware/auth2.js' ) ;
32
31
33
32
class WebServerService extends BaseService {
34
33
static MODULES = {
@@ -69,7 +68,6 @@ class WebServerService extends BaseService {
69
68
// https://expressjs.com/en/guide/error-handling.html
70
69
this . app . use ( require ( '../api/api_error_handler' ) ) ;
71
70
72
- const path = require ( 'path' )
73
71
const { jwt_auth } = require ( '../helpers' ) ;
74
72
75
73
config . http_port = process . env . PORT ?? config . http_port ;
@@ -129,7 +127,16 @@ class WebServerService extends BaseService {
129
127
130
128
const url = config . origin ;
131
129
130
+ // Open the browser to the URL
131
+ try {
132
+ const openModule = await import ( 'open' ) ;
133
+ openModule . default ( url ) ;
134
+ } catch ( e ) {
135
+ console . log ( 'Error opening browser' , e ) ;
136
+ }
137
+
132
138
this . startup_widget = ( ) => {
139
+
133
140
const link = `\x1B[34;1m${ osclink ( url ) } \x1B[0m` ;
134
141
const lines = [
135
142
`Puter is now live at: ${ link } ` ,
0 commit comments