Closed erf closed 3 years ago
@erf did you ever solve this? I'm trying to do the same thing to no avail
Yes. Try this:
final indexHandler = createFileHandler('web/index.html', url: '');
final wsHandler = webSocketHandler(app.handle);
final staticHandler = createStaticHandler('web');
final router = Router();
router.get('/', indexHandler);
router.get('/ws', wsHandler);
router.get('/<file|.*>', staticHandler);
final handler = const shelf.Pipeline()
.addMiddleware(shelf.logRequests())
.addHandler(router);
final server = await io.serve(handler, address.address, port);
I tried the following:
but i only get
Not found
.