Skip to content

Instantly share code, notes, and snippets.

@Saad-ISAA
Created May 14, 2022 11:03
Show Gist options
  • Save Saad-ISAA/437084bea5b2386f9089d6dada0b6945 to your computer and use it in GitHub Desktop.
Save Saad-ISAA/437084bea5b2386f9089d6dada0b6945 to your computer and use it in GitHub Desktop.
'use strict';
const { connect } = require('./helper/mongo');
module.exports = {
/**
* An asynchronous register function that runs before
* your application is initialized.
*
* This gives you an opportunity to extend code.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
register(/*{ strapi }*/) { },
/**
* An asynchronous bootstrap function that runs before
* your application gets started.
*
* This gives you an opportunity to set up your data model,
* run jobs, or perform some special logic.
*/
async bootstrap({ strapi }) {
strapi.mongodb = await connect();
console.log('MongoDB connected', strapi.mongodb.databaseName);
});
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment