birdofpreyru / react-native-static-server

Embedded HTTP server for React Native
https://dr.pogodin.studio/docs/react-native-static-server
Other
135 stars 21 forks source link

Add native methods to obtain the currently running service #95

Closed ShaoGongBra closed 8 months ago

ShaoGongBra commented 8 months ago

For example, when I use react native code push together, it will restart the entire JS, causing the loss of variables in the JS, but the native service will still be running

birdofpreyru commented 8 months ago

@ShaoGongBra why don’t you just terminate the server before the JS engine reset, and start a new one after? What you ask can be implemented, but requires extra work, and so far I don’t see much benefit, especially for a general use case.

ShaoGongBra commented 8 months ago

I do indeed operate in this way now, but I have found that sometimes stopping the service is slow on Windows

birdofpreyru commented 8 months ago

Well, Christmas present — «Connecting to an Active Server in the Native Layer» in v0.10.1. I believe, it should get you covered, though I have not tested it end-to-end, thus might need some minor fixes.