Giter VIP home page Giter VIP logo

cron-as-a-service's Introduction

cron-as-a-service

A simple remote cron service using Node.js and MongoDB.

Features

  • Each cron job polls a web resource via a GET request at regular intervals.
  • Familiar cron scheduling (e.g. '00 30 11 * * 2-6') (powered by node-cron).
  • Comprehensive RESTful API for creating, listing, updating and deleting cron jobs
  • Easy installation and zero administration

Installation

Clone the repository from GitHub and install dependencies using npm:

> git clone git://github.com/fzaninotto/cron-as-a-service.git
> npm install

Start the application with:

> node app

Head to the API root for a list of available resources:

http://localhost:8082/api/

Jobs CRUD

A job is composed of an expression and an url.

// to create a job, send a POST request to the /api/jobs route
curl -d 'expression=* * * * * *&url=http://localhost:8888' http://localhost:8082/api/jobs
// to list jobs, send a GET requst to the /api/jobs route
curl http://localhost:8082/api/job
// to update a job, send a PUT request to the /api/jobs/:id route
curl -X PUT -d 'expression=* * * * * *&url=http://localhost:8888' http://localhost:8082/api/jobs/4fcd284b87cf3b5a07000004
// to remove a job, send a DELETE request to the /api/jobs/:id route
curl -X DELETE http://localhost:8082/api/jobs/4fcd284b87cf3b5a07000004

The job expression follows the cron pattern syntax described here.

Tip: You can start the provided dummy target to test the job polling:

> node fixtures/dummyTarget.js

Customization

Uptime uses node-config to allow YAML configuration and environment support. Here is the default configuration, taken from config/default.yaml:

mongodb:
  server:   localhost
  database: cron
  user:     root 
  password:

server:
  port:     8082

To modify this configuration, create a development.yaml or a production.yaml file in the same directory, and override just the settings you need. For instance, to run the service on port 80 in production, create a production.yaml file as follows:

server:
  port:     80

LICENSE

The code is free to use and distribute, under the MIT license.

TODO

  • Web GUI
  • Record response status for each executed job
  • Run jobs in a separate process
  • Deal with web proxies

cron-as-a-service's People

Contributors

fzaninotto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cron-as-a-service's Issues

Package.json libary versions

Hello,

I'm looking forward to use your application, but can you please specify versions you used when pulling the libaries from the internet (in package.json).

I can't use your software yet, because some options you use are now deprecated :)

Thanks in advance!

Ps.
It looks like u forgot a yaml-reader for the config files (forgive me if im wrong). Please add something like this: "js-yaml": "version-u-use";

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.