Skip to content

Commit

Permalink
docs: update expo go link
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Feb 24, 2024
1 parent 3811708 commit 901cd11
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"jest/*": "off"
}
}, {
"files":["scripts/*.js"],
"files":["scripts/*.js", "netlify/functions/**/*.js"],
"rules": {
"import/no-commonjs": "off"
}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ dist/
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Local Netlify folder
.netlify
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ If you want to run the example from the repo,

You can also run the currently published app:

- For iOS simulator & Android device with [Expo Go](https://expo.dev/client): <https://expo.dev/@react-navigation/react-navigation-example?serviceType=eas&distribution=expo-go&scheme=exp+react-navigation-example&channel=main&sdkVersion=50.0.0>
- For iOS simulator & Android device with [Expo Go](https://expo.dev/client): <https://react-navigation-example.netlify.app/.netlify/functions/expo>
- For web: <https://react-navigation-example.netlify.com/>
20 changes: 20 additions & 0 deletions netlify/functions/expo/expo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const handler = async () => {
try {
const pkg = await fetch(
'https://raw.githubusercontent.com/react-navigation/react-navigation/main/example/package.json'
).then((res) => res.json());

const expo = pkg.dependencies['expo'].replace(/[\^~]/, '').split('.')[0];

return {
statusCode: 302,
headers: {
Location: `https://expo.dev/@react-navigation/react-navigation-example?serviceType=eas&distribution=expo-go&scheme=exp+react-navigation-example&channel=main&sdkVersion=${expo}.0.0`,
},
};
} catch (error) {
return { statusCode: 500, body: error.toString() };
}
};

module.exports = { handler };

0 comments on commit 901cd11

Please sign in to comment.