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

Help... I Got error Name==null #5

Closed
merby04 opened this issue May 15, 2017 · 14 comments
Closed

Help... I Got error Name==null #5

merby04 opened this issue May 15, 2017 · 14 comments

Comments

@merby04
Copy link

merby04 commented May 15, 2017

No description provided.

@Stophface
Copy link

@x5c Did you solve it? I get the same error.

@jishuke
Copy link

jishuke commented Nov 22, 2017

When I put it into Android, he reported this mistake. Please help me.

@jishuke
Copy link

jishuke commented Nov 22, 2017

I follow the steps on the Android mobile phone, such as map error
wechatimg352

@Stophface
Copy link

Stophface commented Nov 22, 2017

The docs are a little missleading @BubbleCoding
Make sure you pass it a path to a folder where the server is running on.
I think it does not hurt if you specify the port explicitly

@jishuke
Copy link

jishuke commented Nov 22, 2017

@Stophface
port and path two parameters needed to pass on Android? Is default localhost not available?

@Stophface
Copy link

@BubbleCoding Nope. I got the same error when I relied on default localhost. Pass it 8080 or whatever, and it should work :)

@jishuke
Copy link

jishuke commented Nov 22, 2017

@Stophface My code is like this

import StaticServer from 'react-native-static-server';
let server = new StaticServer(8080);
// Start the server
server.start().then(url => {
console.log('Serving at URL', url);
});

@jishuke
Copy link

jishuke commented Nov 22, 2017

@Stophface How did you solve it? Can you explain it in detail? Thank you

@Stophface
Copy link

Stophface commented Nov 22, 2017

@BubbleCoding what is url? That should be a path to a folder in your filesystem on the device.

Something like

let server = new StaticServer(8080, '/path/to/folder');

server.start().then(url => {
    console.log('Serving at URL', url);
});

To access the filesystem, use https://github.com/wkh237/react-native-fetch-blob#user-content-file-system

@jishuke
Copy link

jishuke commented Nov 22, 2017

Thank you. I want to interface to different /inputMoneyValue and /mdbStatus and /openDoorResult by http://192.168.8.132:8080/. What should I do?

@Stophface
Copy link

Stophface commented Nov 22, 2017

@BubbleCoding sorry, I dont understand you. If /inputMoneyValue and /mdbStatus and /openDoorResult are folders in your filesystem, use https://github.com/wkh237/react-native-fetch-blob#user-content-file-system. The documentation is quite extensive :)

@jishuke
Copy link

jishuke commented Nov 22, 2017

@Stophface Thank you. I want to interface to different /inputMoneyValue and /mdbStatus and /openDoorResult by http://192.168.8.132:8080/. What should I do?

@jishuke
Copy link

jishuke commented Nov 22, 2017

@Stophface Thank you for your patience in helping me. I want to turn it into a mini server, it will receive different Url such as http://192.168.8.132:8080/inputMoneyValue and http://192.168.8.132:8080/mdbStatus and it will return some data such as: JSON {"MSG": "status notification interface"}

@Stophface
Copy link

@BubbleCoding I am not sure if this library is the correct one for doing this

The docs say

StaticServer serves from the document directory (default) or takes an optional absolute path to serve from.

It says document directory or absolute path. As far as I understand it, it needs a folder to serve from. Maybe overthink what you are doing or consider another library.

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

3 participants