Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server started but 404 on Webview #101

Open
danilocanalle opened this issue Nov 13, 2020 · 1 comment
Open

Server started but 404 on Webview #101

danilocanalle opened this issue Nov 13, 2020 · 1 comment

Comments

@danilocanalle
Copy link

Hello,

I dont know what Iam missing here, but I have started the server in the default location, using:

const webServer = new StaticServer(3030, { localOnly: true, keepAlive: true, });

That is supposed to be on Documents directory.

I have downloaded some files into there (index.html, etc), but when I set my webview uri to http://localhost:3030/, I got a 404 error.

I am testing on iOS.

"react-native": "0.63.2",
"react-native-static-server": "^0.5.0",
"react-native-webview": "^9.4.0",

Someone got that too ?

@danilocanalle
Copy link
Author

I found out the problem.

I was using expo-file-system to get Documents directory, it gives me "file://"
I changed to react-native-fs, it gives me the path without "file://"

...

Thanks anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant