serveme
serveme copied to clipboard
Where config.yaml should be placed using flutter framework?
Using your documentation I was able to run a standalone server but there's a problem I'm having porting your code into flutter. I'm using version 1.2.1.
E/flutter (24580): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Unable to load configuration file "config.yaml": PathNotFoundException: Cannot open file, path = 'config.yaml' (OS Error: No such file or directory, errno = 2) E/flutter (24580): #0 Config._instantiate config.dart:80 E/flutter (24580): #1 new ServeMe serveme.dart:36 E/flutter (24580): #2 WebSocketServer.setup
Could you please tell me where the config.yaml should be placed? It doesn't work either in a root directory or within the server class file.
config.yaml should be placed in the project root directory, same where your pubspec.yaml is.
Keep in mind, however, that ServeMe is a server side package. It's not meant to be used on the client side (like Flutter app). If you need to connect your Flutter app to the ServeMe server, you should use ConnectMe package for that.
Yes I'm aware that's a sever side package, even that's not a common case I have to implement it this way. So do you think is there a chance to use package in flutter? Unfortunately placing config.yaml in root directory doesn't work. The error is the same as above, below I've created a test repo, everything is being set up in main.dart. https://github.com/ytneu/serveme-flutter-test
I guess in this case you need to specify it as an asset and specify the assets folder (or file path) in pubspec.yaml. I didn't try it myself though. Can I ask you what's the purpose of using ServeMe on Flutter? It doesn't make any sense to me :)
I've tried these method before but unfortunately it doesn't work either. The application is part of an iot project, the key requirement is that websocket server must be running on a phone, than it manages mutliple embedded devices.
It would be much appreciated if you could check this behavior in flutter, thank you in advance.