Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add dynamic commands registering #49

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <command>
```

```
2. cd clocal-gcp
```

```
3. yarn
```
# 📚 Overview

```
4. yarn dev <command>
```
_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
13 changes: 10 additions & 3 deletions bin/clocal-gcp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/services/cloud-memory-store/cloud-memory-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion src/services/cloud-storage/cloud-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down