cronserver
v1.0.0
Published
Cron Server
Downloads
2
Readme
Emil Cron Server
The guide herein describes how to get the Cron server up and running
Invoking locally
Before starting the server locally, ensure you have updated the app.env
file with proper configuration for the environment variables.
If you have npm and node (v >= 6.10) installed
Run the following commands to start a server:
npm install pm2 -g
npm install
npm start
Using Docker with Docker installed (v >= 1.12)
Run the following command to start the local server:
sh local/start.sh
Code Quality and Tests
While this project is largely made up of scripts, it's no excuse to write crappy code. Linting and unit tests have been setup for the project. To run linting:
npm run lint
To run unit tests:
npm test
All commands are to be run from a node environment which you can access in docker by running the command:
docker exec -it cronserver bash
A one-time job run can be achieved using the command:
npm run job job_name date_to_run_for[optional]
where job_name is the name of the job file (without the .js) as found in app/jobs directory and the date_to_run for is an optional date argument which can be supplied to run for a specific date
Code documentation:
Yuidocjs is used to generate code documentation. To do this, run the following commands:
npm install yuidocjs -g
yuidoc .
A directory would be created in the project root called out
where you'd find the index.html
entry point for the generated docs
License
MIT