Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ Please follow instructions from the [expo website](https://expo.io/learn) to see
npm install
```

Then update the IP address in `components/Server.tsx` to point to the IP address of the computer running the local server:
```js
3: const URL = "http://192.168.1.29:8080";
```
Then update the IP address to point to the IP address of the computer running the local server by either:

1. Using environment variable `AR_CP_SERVER_URL` or
2. in the `serverUrl` field in [app.json](/app/app.json)

eg `"serverUrl": "http://192.168.1.29:8080"`

## Run

If you have supplied the environment variable `AR_CP_SERVER_URL`
```bash
AR_CP_SERVER_URL="http://<ip>:<port>" npm start
```
else
```bash
npm start
```
7 changes: 7 additions & 0 deletions app/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default ({config}) => {
return {
extra: {
"serverUrl": process.env.AR_CP_SERVER_URL || config.serverUrl
}
}
}
1 change: 1 addition & 0 deletions app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"serverUrl": "http://<ip>:<port>",
"updates": {
"fallbackToCacheTimeout": 0
},
Expand Down
3 changes: 2 additions & 1 deletion app/components/Server.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Base64 from "./Base64";
import Constants from 'expo-constants';

const URL = "http://192.168.1.29:8080";
const URL = Constants.manifest.extra.serverUrl;

function arrayBufferToBase64(buffer: ArrayBuffer) {
let binary = "";
Expand Down