- https://www.easycron.com/
- https://heroku.com
- google calender API
because using the free version of the heroku account so many restrictions are obtained, therefore additional tools use easycron to run the scheduler.
EMAIL=xxx
PASSWORD=xx
DEVICE_ID=xxx
LATITUDE=-6.3443904
LONGITUDE=106.8705516
SECRET_KEY=xxx //for middleware service
API_KEY_GOOGLE_CALENDER=xxxx
GOOGLE_CALENDER_ID=xxxx //by default use calenderId indonesia, for more calenderid visit https://gist.github.com/mattn/1438183
- SetUp heroku
- SetUp easycron
- SetUp Env file
- Change file selfie.JPG to your own photo
/ping --> ping service
/checkin --> checkin absent
/checkout --> checkout absent
//by default serve rest api
// CRON_CHECKIN = "1 8 * * 1,2,3,4,5" --> “At 08:01 on Monday, Tuesday,Wednesday, Thursday, and Friday.”
// CRON_CHECKOUT = "1 20 * * 1,2,3,4,5" --> “At 20:01 on Monday, Tuesday,Wednesday, Thursday, and Friday.”
func main() {
log.Println("Start")
helper.Dispatcher.Run()
//UNCOMMENT THIS FUNCTION IF YOU RUNNING WITH YOUR OWN CRON
cron.RunJob()
//running with rest api
//gate.Route()
log.Println("Finish")
}