File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
blog/25-07-24/http-server Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -203,9 +203,8 @@ <h4 class=blog-hdr>
203203 </ p >
204204 < p >
205205 The server is typically accessed via
206- < br >
207- < a href ='http://localhost:3002/hello ' target ='_blank '>
208- http://localhost:3002/hello
206+ < a href ='http://localhost:3002/ ' target ='_blank '>
207+ http://localhost:3002/
209208 </ a >
210209 </ p >
211210
@@ -322,19 +321,31 @@ <h4 class=blog-hdr>
322321 } //server-ready
323322
324323
324+ minimal . on [ 'init' ] = async function ( { webcontainer} ) {
325+ console . log ( 'minimal.on.init' , webcontainer ) ;
326+ await webcontainer . mount ( minimal . files ) ;
327+
328+ } //init
329+
325330 minimal . on [ 'server-ready' ] = function ( { url, port} ) {
326331 console . log ( 'server-ready' , url , port ) ;
327332 minimal . server . url = url ;
328333 minimal . server . port = port ;
329334
330- var path = '/hello ' ;
335+ var path = '/index.html ' ;
331336 $ ( minimal . root , '#web-page-url' ) . value = path ;
332337
333338 minimal . iframe . src = `${ url } ${ path } ` ;
334339
335340 } //server-ready
336341
337-
342+ minimal . files = {
343+ 'index.html' : { file :{ contents :`
344+ <style>html{font-family:arial}body{margin:20px}</style>
345+ <h3>HTTPS Works!</h3>
346+ <h4 style='color:blue'>/hello</h4>
347+ ` } } ,
348+ } ;
338349
339350
340351 </ script >
You can’t perform that action at this time.
0 commit comments