mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Website: Update Fleet website search index when website server starts. (#9480)
Changes: - Updated the custom hook to include a POST request to Algolia to refresh the Fleetdm.com search index. Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
This commit is contained in:
parent
efc34ebe70
commit
5fabe6ce2d
10
website/api/hooks/custom/index.js
vendored
10
website/api/hooks/custom/index.js
vendored
@ -84,6 +84,16 @@ will be disabled and/or hidden in the UI.
|
||||
fromName: sails.config.custom.fromName,
|
||||
});
|
||||
|
||||
if(sails.config.environment === 'production'){
|
||||
sails.helpers.http.post.with({
|
||||
url: `https://crawler.algolia.com/api/1/crawlers/${sails.config.custom.algoliaCrawlerId}/reindex`,
|
||||
headers: { 'Authorization': sails.config.custom.algoliaCrawlerApiToken}
|
||||
}).exec((err)=>{
|
||||
if(err){
|
||||
sails.log.warn('When trying to send a request to Algolia to refresh the Fleet website search index, an error occurred: '+err);
|
||||
}
|
||||
});//_∏_
|
||||
}
|
||||
});//_∏_
|
||||
|
||||
// ... Any other app-specific setup code that needs to run on lift,
|
||||
|
Loading…
Reference in New Issue
Block a user