This project is a bootstrapper for downloading, setting up, and running a Node.js application. It automates the process of fetching the latest version of an app from a remote URL, unzipping it, installing dependencies, and starting the app.
- Automatically downloads the latest version of the app.
- Cleans up old versions before setup.
- Installs dependencies and starts the app.
- Compares the current app version with the latest version to decide whether to update.
- Node.js and npm installed on your system.
- Ensure you have access to the URLs specified in the
.env
file.
-
Clone this repository:
git clone <repository-url> cd shell
-
Install dependencies:
npm install
-
Configure the
.env
file (see below for details). -
Start the bootstrapper:
npm start
The .env
file contains environment variables required for the app to function. Below is an explanation of each variable:
APP_URL
: The URL to download the zipped Node.js app.INFO_URL
: The URL to fetch the latest version information of the app.FILE_NAME
: The name of the downloaded zip file.FOLDER_NAME
: The name of the folder extracted from the zip file.
APP_URL="https://example.com/dev/simple-nodejs-app-master.zip"
INFO_URL="https://example.com/dev/simple-nodejs-app-master-info.json"
FILE_NAME="simple-nodejs-app-master.zip"
FOLDER_NAME="simple-nodejs-app-master"
The info-template.json
file is used to define the structure of the version information fetched from the INFO_URL
. Below is an example:
{
"version": "2.0"
}
This file ensures that the app can compare the current version with the latest version available remotely.
- If the app fails to start, ensure the
.env
file is correctly configured. - Check your internet connection if the app cannot download the zip file.
- Ensure Node.js and npm are installed and accessible in your system's PATH.
This project is licensed under the ISC License.