You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i try to create plugin, one of task is run server with static page, i have problem to serve static file
final int _port;
final String _host;
WebHttpServer({
String host = '127.0.0.1',
int port = 9091,
}) : _port = port,
_host = host;
final _staticHandler = createAssetHandler(
rootPath: 'assets/web/', defaultDocument: 'index.html');
Future<void> start() async {
log('HIVE VIEW CE: Starting HTTP Server');
var handler = const Pipeline()
.addMiddleware(corsHeaders())
.addHandler(_staticHandler);
await shelf_io.serve(
handler,
_host,
_port,
);
log('HIVE VIEW CE: HTTP Server started on http://$_host:$_port');
}
}```
server start but can't load index.html
i think problem is path because this is plugin with assets
The text was updated successfully, but these errors were encountered:
Hello, i try to create plugin, one of task is run server with static page, i have problem to serve static file
The text was updated successfully, but these errors were encountered: