0

I have a script where I update some things to a Shopify shop, however, it works only when I press a button, using a server router:

router.post('/sync_shopify_with_set/:id', TokenController.isAValidToken, async (req, res) => {
    try {
        await ShopifyController.syncShopifyWithSetState(req.params.id);
        res.json({
            success: true
        });
        console.log('Shopify updated');
    } catch (error) {
        ErrorController.errorCallback(error, res);
    }
});

How can I make it so than, whenever the clock strikes 12 at night (CST), the await ShopifyController.syncShopifyWithSetState(req.params.id) function executes automatically? (Wether via a router or another way).

This code is all hosted in my server.

Daniel Corona
  • 839
  • 14
  • 34

0 Answers0