Skip to content

Commit 04c8109

Browse files
remove check for index file since there is now an example site
1 parent 0a28d01 commit 04c8109

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

bin/server.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ import 'package:shelf_static/shelf_static.dart';
55

66
void 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
}

0 commit comments

Comments
 (0)