@@ -10,6 +10,9 @@ const defaultDev = {
1010 "port" : "3000"
1111} ;
1212
13+ const TEMPLATE_FILE = 'examples/example.template.html' ;
14+ const DEV_HTML = 'dev.html' ;
15+
1316async function fileExists ( filePath ) {
1417 try {
1518 await fs . access ( filePath ) ;
@@ -61,8 +64,8 @@ async function processTemplate(templateFile, outputFile, replacements) {
6164
6265async function writeExampleHtml ( config ) {
6366 // Define your file paths and replacements
64- const templateFile = path . join ( __dirname , 'examples/example.template.html' ) ;
65- const outputFile = path . join ( __dirname , 'dev.html' ) ;
67+ const templateFile = path . join ( __dirname , TEMPLATE_FILE ) ;
68+ const outputFile = path . join ( __dirname , DEV_HTML ) ;
6669 const replacements = {
6770 'key_place_holder' : config . sdkKey ,
6871 'api_place_holder' : config . APIEndpoint ,
@@ -79,13 +82,12 @@ function executeBuild(config) {
7982 console . error ( `Error executing makefile: ${ error . message } ` ) ;
8083 return ;
8184 }
82- console . log ( 'Dev build successful.' ) ;
83- console . log ( 'Starting server...' ) ;
85+ console . log ( `Dev websdk build successful, ${ DEV_HTML } built from ${ TEMPLATE_FILE } ` ) ;
8486 const app = new Koa ( ) ;
8587 app . use ( serve ( '.' ) ) ;
8688 app . listen ( config . port , ( ) => {
8789 console . log ( 'Server started successfully.' ) ;
88- console . log ( `Example page running at http://localhost:${ config . port } /dev.html ` ) ;
90+ console . log ( `Example page running at http://localhost:${ config . port } /${ DEV_HTML } . To edit, update ${ TEMPLATE_FILE } ` ) ;
8991 } ) ;
9092 } ) ;
9193}
0 commit comments