Skip to content

Commit

Permalink
[issue-988] Fix static server to support cors
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenduythuc committed Sep 15, 2023
1 parent fc38d09 commit 8837247
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 267 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ There are 2 reasons why we do this:
### Requirement
- Install [yarn](https://yarnpkg.com/)
- Setup [react native development environment](https://reactnative.dev/docs/environment-setup) use React Native CLI.
- [CMake] is required on the build host for web runner.

- When building for **Android**, [CMake] should be installed as a part of your
_Android SDK_ (open _SDK Manager_, and look for [CMake] within
the _SDK Tools_ tab).

- On **MacOS**, the `pkg-config` dependency is also needed. You can install both via [Homebrew],
by executing:
```shell
$ brew install cmake pkg-config
```
**IMPORTANT:** [Homebrew] should have added `eval "$(/opt/homebrew/bin/brew shellenv)"'`
command to your `.zshrc` or `.bashrc`. Although this works for interactive terminals,
it might not work for sessions inside of other apps, such as XCode, therefore you might need to
manually create symbolic links:
```shell
$ sudo ln -s $(which cmake) /usr/local/bin/cmake
$ sudo ln -s $(which pkg-config) /usr/local/bin/pkg-config
```
For details read: https://earthly.dev/blog/homebrew-on-m1,
and [Issue#29](https://github.com/birdofpreyru/react-native-static-server/issues/29).
### Start development
- From package folder run `yarn start` to make sure we installed all required packages
Expand Down
47 changes: 16 additions & 31 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,26 @@ PODS:
- FlipperKit/Core
- FlipperKit/FlipperKitNetworkPlugin
- fmt (6.2.1)
- GCDWebServer (3.5.4):
- GCDWebServer/Core (= 3.5.4)
- GCDWebServer/Core (3.5.4)
- glog (0.3.5)
- hermes-engine (0.71.12):
- hermes-engine/Pre-built (= 0.71.12)
- hermes-engine/Pre-built (0.71.12)
- libevent (2.1.12)
- libwebp (1.2.4):
- libwebp/demux (= 1.2.4)
- libwebp/mux (= 1.2.4)
- libwebp/webp (= 1.2.4)
- libwebp/demux (1.2.4):
- libwebp (1.3.1):
- libwebp/demux (= 1.3.1)
- libwebp/mux (= 1.3.1)
- libwebp/sharpyuv (= 1.3.1)
- libwebp/webp (= 1.3.1)
- libwebp/demux (1.3.1):
- libwebp/webp
- libwebp/mux (1.2.4):
- libwebp/mux (1.3.1):
- libwebp/demux
- libwebp/webp (1.2.4)
- MMKV (1.3.0):
- MMKVCore (~> 1.3.0)
- MMKVCore (1.3.0)
- libwebp/sharpyuv (1.3.1)
- libwebp/webp (1.3.1):
- libwebp/sharpyuv
- MMKV (1.3.1):
- MMKVCore (~> 1.3.1)
- MMKVCore (1.3.1)
- OpenSSL-Universal (1.1.1100)
- RCT-Folly (2021.07.22.00):
- boost
Expand Down Expand Up @@ -377,9 +377,6 @@ PODS:
- React-Core
- react-native-splash-screen (3.3.0):
- React-Core
- react-native-static-server (0.5.0):
- GCDWebServer (~> 3.0)
- React
- react-native-version-number (0.3.6):
- React
- react-native-video (5.2.1):
Expand Down Expand Up @@ -493,8 +490,6 @@ PODS:
- React-Core
- SDWebImage (~> 5.11.1)
- SDWebImageWebPCoder (~> 0.8.4)
- RNFS (2.20.0):
- React-Core
- RNGestureHandler (2.12.0):
- React-Core
- RNInAppBrowser (3.7.0):
Expand Down Expand Up @@ -613,7 +608,6 @@ DEPENDENCIES:
- react-native-sensitive-info (from `../node_modules/react-native-sensitive-info`)
- "react-native-slider (from `../node_modules/@react-native-community/slider`)"
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- react-native-static-server (from `../node_modules/react-native-static-server`)
- react-native-version-number (from `../node_modules/react-native-version-number`)
- react-native-video (from `../node_modules/react-native-video`)
- react-native-view-shot (from `../node_modules/react-native-view-shot`)
Expand All @@ -639,7 +633,6 @@ DEPENDENCIES:
- "RNCPicker (from `../node_modules/@react-native-picker/picker`)"
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
- RNFastImage (from `../node_modules/react-native-fast-image`)
- RNFS (from `../node_modules/react-native-fs`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNInAppBrowser (from `../node_modules/react-native-inappbrowser-reborn`)
- RNKeychain (from `../node_modules/react-native-keychain`)
Expand All @@ -664,7 +657,6 @@ SPEC REPOS:
- Flipper-RSocket
- FlipperKit
- fmt
- GCDWebServer
- libevent
- libwebp
- MMKV
Expand Down Expand Up @@ -743,8 +735,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/@react-native-community/slider"
react-native-splash-screen:
:path: "../node_modules/react-native-splash-screen"
react-native-static-server:
:path: "../node_modules/react-native-static-server"
react-native-version-number:
:path: "../node_modules/react-native-version-number"
react-native-video:
Expand Down Expand Up @@ -795,8 +785,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-device-info"
RNFastImage:
:path: "../node_modules/react-native-fast-image"
RNFS:
:path: "../node_modules/react-native-fs"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
RNInAppBrowser:
Expand Down Expand Up @@ -835,13 +823,12 @@ SPEC CHECKSUMS:
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: b60ebc812e0179a612d8146ac54730d533c804a2
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
MMKV: 9c6c3fa4ddd849f28c7b9a5c9d23aab84f14ee35
MMKVCore: 9bb7440b170181ac5b81f542ac258103542e693d
libwebp: 33dc822fbbf4503668d09f7885bbfedc76c45e96
MMKV: 5a07930c70c70b86cd87761a42c8f3836fb681d7
MMKVCore: e50135dbd33235b6ab390635991bab437ab873c0
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 4db5e3e18b906377a502da5b358ff159ba4783ed
Expand Down Expand Up @@ -869,7 +856,6 @@ SPEC CHECKSUMS:
react-native-sensitive-info: d44e909d065f9c0e15734245e5dd6a24b82e3dcd
react-native-slider: 33b8d190b59d4f67a541061bb91775d53d617d9d
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
react-native-static-server: 201b2a945a35096be3ae7f43e367c65bcbd61343
react-native-version-number: b415bbec6a13f2df62bf978e85bc0d699462f37f
react-native-video: c26780b224543c62d5e1b2a7244a5cd1b50e8253
react-native-view-shot: f5507655f122e6b104888a11130f267a427f0d57
Expand All @@ -895,7 +881,6 @@ SPEC CHECKSUMS:
RNCPicker: 0bc2f0a29abcca7b7ed44a2d036aac9ab6d25700
RNDeviceInfo: 5795b418ed3451ebcaf39384e6cf51f60cb931c9
RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
RNGestureHandler: dec4645026e7401a0899f2846d864403478ff6a5
RNInAppBrowser: e36d6935517101ccba0e875bac8ad7b0cb655364
RNKeychain: a65256b6ca6ba6976132cc4124b238a5b13b3d9c
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"test": "jest"
},
"dependencies": {
"@dr.pogodin/react-native-fs": ">=2.21.0-alpha.1",
"@dr.pogodin/react-native-static-server": "0.8.3",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-regular-svg-icons": "^6.2.1",
Expand Down Expand Up @@ -83,7 +85,6 @@
"react-native-elements": "^3.4.3",
"react-native-error-boundary": "^1.2.3",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.9.0",
"react-native-image-picker": "^5.0.1",
"react-native-inappbrowser-reborn": "^3.7.0",
Expand All @@ -105,7 +106,6 @@
"react-native-sensitive-info": "^6.0.0-alpha.9",
"react-native-skeleton-placeholder": "^5.2.4",
"react-native-splash-screen": "^3.3.0",
"react-native-static-server": "^0.5.0",
"react-native-status-bar-height": "^2.6.0",
"react-native-svg": "^13.6.0",
"react-native-svg-transformer": "^1.0.0",
Expand Down
Loading

0 comments on commit 8837247

Please sign in to comment.