Console (Rollback & Force Update)

Opens a localhost server based on plugins configured in hot-updater.config.ts. For security reasons, only localhost server is supported at the moment.

The console provides the following features:

  • Rollback
  • Force update flag
  • Quick access to git history for updates

Configuration

You can configure additional console settings in the hot-updater.config.ts file.

The storage and database plugins must be exist.

OptionDescriptionDefault
console.gitUrlEnables commit shortcuts by linking to git commit hashes-
console.portSets the console server port1422
hot-updater.config.ts
import { defineConfig } from "hot-updater";

export default defineConfig({
  console: { 
    gitUrl: "https://github.com/gronxb/hot-updater", 
    port: 3000, 
  }, 
  build: ...,
  storage: ...,
  database: ...,
});

Usage

Execute the following command:

npm
pnpm
yarn
npx hot-updater console

Rollback

When you set a bundle's enabled status to false in the console, users who have that bundle will immediately force update to the previous bundle.

Force Update

When you set a bundle's shouldForceUpdate status to true in the console, users who have that bundle will immediately force update to the latest bundle.

Git URL

You can set the git URL in the hot-updater.config.ts file.

hot-updater.config.ts
import { defineConfig } from "hot-updater";

export default defineConfig({
  console: {
    gitUrl: "<your-repo>", // e.g. https://github.com/gronxb/hot-updater 
  },
});

When you set the git URL, the commit hash will be clickable and redirect you to the corresponding commit in your repository.