mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 01:47:13 +00:00 
			
		
		
		
	 244b280919
			
		
	
	
		244b280919
		
	
	
	
	
		
			
			strapi.store(source).get(params)
strapi.store(source).set({params, value})
Co-authored-by: Aurelsicoko <aurelsicoko@gmail.com>
		
	
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			576 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			576 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| /**
 | |
|  * 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.
 | |
|  */
 | |
| 
 | |
| module.exports = async cb => {
 | |
|   const pluginStore = strapi.store({
 | |
|     environment: '',
 | |
|     type: 'core'
 | |
|   });
 | |
| 
 | |
|   if (!await pluginStore.get({key: 'application'})) {
 | |
|     const value = {
 | |
|       name: 'Default Application',
 | |
|       description: 'This API is going to be awesome!'
 | |
|     };
 | |
| 
 | |
|     await pluginStore.set({key: 'application', value});
 | |
|   }
 | |
| 
 | |
|   cb();
 | |
| };
 |