Custom expo update server using NestJS
- There is currently an issue with expo-updates that forces it to override all asset urls with expo cdn urls, even when using a custom updates server.
- This is fine if expo cdn server is working properly for you, but if you want to change this default behavior for any reason, there is a way to modify your project's expo-updates package directly via patch-package or something.
-
Need Mysql or MariaDB
-
create new certificate (if you want to use code signing)
yarn certificate:generate
-
install dependencies
yarn install
# development
yarn start
# watch mode
yarn start:dev
# production mode
yarn start:prod
-
Modify app.config.js or something.
// in app.config.js module.exports = { // ... // Remove exist options // updates: { // url: `https://u.expo.dev/${expoProjectId}`, // fallbackToCacheTimeout: 0, // }, // Use it instead updates: { url: `https://example.com/api/update/expo/manifests/release/default/latest`, // or use releaseName // url: `https://example.com/api/update/expo/manifests/release/${releaseName}/latest`, enabled: true, fallbackToCacheTimeout: 30000, codeSigningCertificate: './secrets/certificate.pem', codeSigningMetadata: { keyid: 'main', alg: 'rsa-v1_5-sha256' }, }, // ... };
-
Rebuild your app.
-
Upload new release to your server.
./scripts/upload/sh -d /path/to/build -v 1.0.0 https://example.com/api/update/expo/upload
-
Rerun your app to get new update.
-
Enjoy!
- Add tests
- Add pretty frontend gui
- Add compressed build file upload (such as
build.tar.gz
) - Add importable NestJS module
- Add multiple app support
- Provide device-specific manifests based on updater IDs