https://github.com/manideepk90/hyperOTAServer.git
A Node.js server for serving Over-The-Air (OTA) updates and configurations for mobile applications.
npm install
# or
yarn install
node server.js
The server will start on port 3000 (or the port specified in the PORT environment variable) and display all available network interfaces.
/mobile-ota/android/:version/config.json/mobile-ota/android/1.0.0/config.json/mobile-ota/ios/:version/config.json/mobile-ota/ios/2.0.0/config.json/files - Lists all files in the Android uploads directory/files/android/:filename - Download a specific Android file/files/ios/:filename - Download a specific iOS file/files/locale/:localeName - Download a specific locale fileThe server supports serving different configurations based on the app version. It follows this priority order:
ota/{version}/config.jsonota/default/config.jsonconfig.jsonios-config2.jsonhyperOTAServer/
โโโ server.js
โโโ package.json
โโโ config.json # Fallback config for Android
โโโ ios-config2.json # Fallback config for iOS
โโโ ota/ # Version-based configs
โ โโโ 1.0.0/
โ โ โโโ config.json
โ โโโ 2.0.0/
โ โ โโโ config.json
โ โโโ default/
โ โโโ config.json
โโโ uploads/
โโโ android/
โโโ ios/
โโโ locales/
When a client requests /mobile-ota/ios/1.0.0/config.json, the server will:
ota/1.0.0/config.jsonota/default/config.jsonios-config2.jsonota directory:mkdir -p ota/1.0.0
mkdir -p ota/2.0.0
mkdir -p ota/default
config.json files in the appropriate folders{
"version": "2",
"config": {
"version": "v2",
"release_config_timeout": 2000,
"boot_timeout": 2000,
"properties": {}
},
"package": {
"name": "Hyperswitch_SDK",
"version": "v2",
"properties": {
"manifest": {},
"manifest_hash": {}
},
"index": {
"url": "http://localhost:3000/files/android/bundle-v1-android.zip",
"filePath": "hyperswitch.bundle"
},
"important": [],
"lazy": []
},
"resources": []
}
The server logs:
The server is configured to accept requests from any origin (*). Modify the CORS settings in server.js if you need to restrict access to specific domains.
PORT: Server port (default: 3000)All endpoints include error handling and will return appropriate HTTP status codes:
404: File or configuration not found500: Server error (e.g., failed to read configuration file)