UNPKG

hgi-gindex

Version:

Module used to send indexing requests to Google service

16 lines (14 loc) 405 B
const sendNotification = async (indexingAPI,urlRoute,urlType = "URL_UPDATED") => { try { await indexingAPI.urlNotifications.publish({ requestBody: { url: urlRoute, type: urlType, }, }); console.log(`Google update notification: ${urlRoute}`); } catch (error) { console.error(`Google notification error: ${error}`); } }; module.exports = sendNotification;