jonataslaw / get_server

A backend server that makes it possible to program with Flutter syntax and reuse existing code
Apache License 2.0
477 stars 42 forks source link

page not found in Android Simulator Fluttter APP with static folder #46

Closed makao007 closed 3 years ago

makao007 commented 3 years ago

Hi, I try to run the get_server in a flutter app on Android Simulator, I can return a Text('Hello') , but when I set a static folder, the page not found. home: FolderWidget('web') // not found the folder

runApp(GetServer( host: '0.0.0.0', port: 8088, home: FolderWidget('web', allowDirectoryListing:true), getPages: [ GetPage(name: '/hello', page:()=>Text('Hello')), ], ));

makao007 commented 3 years ago

I know the reason now. That is because the flutter code can not find the folder, You can create a folder in getApplicationDocumentsDirectory and copy files into the above folder and then FolderWidget(the full folder above)

jonataslaw commented 3 years ago

Glad you found the solution. Based on your comment, I'm closing this