diff --git a/README.md b/README.md index d71c07d..8cb7be5 100644 --- a/README.md +++ b/README.md @@ -2,39 +2,30 @@ Emulation engine for GCP -_clocal-gcp_ provides an easy-to-use test/mocking framework for developing Cloud applications. +clocal-gcp provides an easy-to-use test/mocking framework for developing Cloud applications. Currently features are under development. -# Overview +## 🚀 Install -_clocal-gcp_ spins up the following core Cloud APIs on your local machine: -* **Cloud Functions** at http://localhost:7574 -* **Cloud Data Store** at http://localhost:7569 -* **Cloud CDN** at http://localhost:7581 -* **Cloud ENDPOINTS** at http://localhost:7567 -* **Cloud Storage** at http://localhost:7572 - -## Developing +``` +$ git clone https://github.com/cloudlibz/clocal-gcp.git -Requirements \* +$ cd clocal-gcp -* NodeJS (^8.9.4) -* yarn (^1.6.0) +$ yarn -``` -1. git clone https://github.com/cloudlibz/clocal-gcp.git +$ yarn dev ``` -``` -2. cd clocal-gcp -``` -``` -3. yarn -``` +# 📚 Overview -``` -4. yarn dev -``` +_clocal-gcp_ spins up the following core Cloud APIs on your local machine: + +* **Cloud Functions** at http://localhost:7574 +* **Cloud Data Store** at http://localhost:7569 +* **Cloud CDN** at http://localhost:7581 +* **Cloud ENDPOINTS** at http://localhost:7567 +* **Cloud Storage** at http://localhost:7572 diff --git a/bin/clocal-gcp b/bin/clocal-gcp index e5736df..1bfd383 100755 --- a/bin/clocal-gcp +++ b/bin/clocal-gcp @@ -2,13 +2,20 @@ 'use strict'; +const fs = require('fs'); +const path = require('path'); const program = require('commander'); -const commandsArray = require('../src/services/index').commands; +const commandsArray = []; +const commandNameList = []; +const commandsDirectory = path.join(__dirname, '../src/services/cli-commands'); -program.version('1.0.0').description('Clocal GCP'); +const directories = fs.readdirSync(commandsDirectory); +directories.forEach(dir => { + commandsArray.push(require(path.join(commandsDirectory, dir, '/cmd.js'))); +}); -const commandNameList = []; +program.version('1.0.0').description('Clocal GCP'); commandsArray.map(command => { commandNameList.push(command.commandName); diff --git a/src/services/cloud-memory-store/cloud-memory-store.js b/src/services/cloud-memory-store/cloud-memory-store.js index de86464..5d1c937 100644 --- a/src/services/cloud-memory-store/cloud-memory-store.js +++ b/src/services/cloud-memory-store/cloud-memory-store.js @@ -3,7 +3,6 @@ const CloudLocal = require('./cloud-local'); const bodyParser = require('body-parser'); const MemoryStore = require('./memory-store'); -const express = require('express'); class CloudMemoryStore extends CloudLocal { init() { diff --git a/src/services/cloud-storage/cloud-storage.js b/src/services/cloud-storage/cloud-storage.js index abb3f6d..7e72b5e 100644 --- a/src/services/cloud-storage/cloud-storage.js +++ b/src/services/cloud-storage/cloud-storage.js @@ -5,7 +5,6 @@ const formidable = require('formidable'); const CloudLocal = require('./cloud-local'); const bodyParser = require('body-parser'); const Bucket = require('./bucket'); -const express = require('express'); class CloudStorage extends CloudLocal { init() {