Hi mn, em đang muốn cron chạy tự động 1p 1 lần ( file này để update dữ liệu trong db) thì làm ntn ạ,e search thì chưa hiểu lắm.
ở php thì e viết code ra 1 file rồi thêm cron bằng crontab -e
, rồi dùng * * * * * curl link-to-php
, thì đối với nodejs e convert code từ php sang nodejs rồi thì cron ntn ạ. e cảm ơn
var express = require('express');
var app = express();
app.get('/cron', function (req, res) {
//code
});
app.listen(8888);
hay là viết code rồi cron là * * * * * curl IP:8888/cron
, có phải ko ah.