Nice Commander
NiceCommander runs scheduled and one-off tasks in your Node.js server with a nice UI
Quick Start
Requirements
- Redis Server for distributed locking
- MySQL Server for its task and task-run database
- Amazon CloudWatch Logs Access to store logs
Define your tasks
Create a directory dedicated to your tasks. Create one or many files that export task definitions. Task definitions must conform to the TaskDefinition
TypeScript interface.
// tasks/simple.js/** * Using JSDoc you can type the exported task * @type {import("nice-commander").TaskDefinition} */moduleexports = name: "my-task" async { console; } timeoutAfter: "2 seconds";
If you are using TypeScript you can import the
TaskDefinition
interface and type your task default export with it.
Add NiceCommander to your Express server
NiceCommander is an Express middleware. Create an instance of NiceCommander
and pass required configurations for MySQL and Redis as well as the path you want the UI to be accessible from under mountPath
.
;;;; const app = ; const mountPath = "/nice-commander";const middleware = ;app; app;