mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-07 08:24:21 +01:00
refactor: refactor the api folder & fix how the inconsistency between netlify & serverless-offline routes
This commit is contained in:
9
api/utils/createGlobalModule.js
Normal file
9
api/utils/createGlobalModule.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const createGlobalModule = (name, factoryFn) => {
|
||||
if (!global[name]) {
|
||||
global[name] = factoryFn();
|
||||
}
|
||||
return global[name];
|
||||
}
|
||||
|
||||
module.exports = createGlobalModule
|
||||
|
||||
Reference in New Issue
Block a user