backend-manager 5.9.9 → 5.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/commands/setup.js +9 -0
- package/templates/index.js +12 -0
package/package.json
CHANGED
|
@@ -298,6 +298,15 @@ class SetupCommand extends BaseCommand {
|
|
|
298
298
|
touched++;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
// index.js — entry point for Cloud Functions
|
|
302
|
+
const indexPath = `${self.firebaseProjectPath}/functions/index.js`;
|
|
303
|
+
if (!jetpack.exists(indexPath)) {
|
|
304
|
+
const templatePath = path.join(templatesDir, 'index.js');
|
|
305
|
+
jetpack.copy(templatePath, indexPath);
|
|
306
|
+
ui.status('add', `Created ${chalk.cyan('functions/index.js')}`, { level: 2 });
|
|
307
|
+
touched++;
|
|
308
|
+
}
|
|
309
|
+
|
|
301
310
|
return touched;
|
|
302
311
|
}
|
|
303
312
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Initialize
|
|
3
|
+
*/
|
|
4
|
+
const Manager = (new (require('backend-manager'))).init(exports, {
|
|
5
|
+
});
|
|
6
|
+
const { functions } = Manager.libraries;
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Routes
|
|
10
|
+
Add custom routes below. Built-in routes (auth, payments, newsletters,
|
|
11
|
+
usage, etc.) are registered automatically by Backend Manager.
|
|
12
|
+
*/
|