File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,13 +5,7 @@ import 'package:shelf_static/shelf_static.dart';
55
66void main () async {
77 // Check if index.html exists
8- String indexFile = 'build/web/index.html' ;
9- bool indexFileExists = await File ('build/web/index.html' ).exists ();
10-
11- if (! indexFileExists) {
12- indexFile = 'README.md' ;
13- }
14-
8+ String indexFile = 'index.html' ;
159 final handler = const Pipeline ()
1610 .addMiddleware (logRequests ())
1711 .addMiddleware (_corsHeaders) // Add CORS headers middleware
@@ -24,7 +18,8 @@ void main() async {
2418
2519 final server = await io.serve (handler, InternetAddress .anyIPv4, 4001 );
2620 final server2 = await io.serve (handler2, InternetAddress .anyIPv4, 4002 );
27- print ('Serving static site at http://${server .address .host }:${server .port }' );
21+ print (
22+ 'Serving static site at http://${server .address .host }:${server .port }/${indexFile }' );
2823 print (
2924 'Serving handling requests at http://${server2 .address .host }:${server2 .port }' );
3025}
You can’t perform that action at this time.
0 commit comments