Skip to content

Commit fce0ca1

Browse files
authored
Merge pull request #34 from oslabs-beta/ted-dev
Ted dev
2 parents 35406b8 + 2edc85a commit fce0ca1

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

examples/microservices/Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Define directories
2+
DIRS := auth client client-dev common event-bus inventory items orders
3+
4+
# Define the content of the .env file
5+
define ENV_CONTENT
6+
CHRONOS_DB=MongoDB
7+
# Database connection string for Chronos to write metric to
8+
CHRONOS_URI=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
9+
10+
# Database connection strings for each microservice
11+
MONGO_URI_AUTH=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
12+
MONGO_URI_ITEMS=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
13+
MONGO_URI_INVENTORY=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
14+
MONGO_URI_ORDERS=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
15+
16+
# this is the secret for auth service to sign/verify json web tokens
17+
JWT_KEY=thisStringDoesNotMatterItJustNeedsToBeDefined
18+
# this is time til expiration for the json web token
19+
JWT_LIFETIME=1d
20+
endef
21+
22+
export ENV_CONTENT
23+
24+
# Default target
25+
all: create_dirs create_env_files
26+
27+
# Create directoriesgit
28+
create_dirs:
29+
@$(foreach dir,$(DIRS),mkdir -p $(dir);)
30+
31+
# Create .env files
32+
create_env_files:
33+
@$(foreach dir,$(DIRS),echo "$$ENV_CONTENT" > $(dir)/.env;)
34+
35+
# Clean up .env files
36+
clean:
37+
@$(foreach dir,$(DIRS),rm -f $(dir)/.env;)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
"backend-test": "npx jest --config __backend-tests__/jest.config.js --verbose",
9494
"start:selenium": "node e2e/seleniumTest.js",
9595
"start:e2e": "npm run dev:electron & npm run start:selenium",
96-
"start": "concurrently \"npm:build\" \"npm:dev:app\" \"npm:dev:electron\""
96+
"start:electron": "concurrently \"npm:build\" \"npm:dev:app\" \"npm:dev:electron\"",
97+
"start:microservices": "cd examples/microservices && make all && npm run pkg:install && npm start"
9798
},
9899
"repository": {
99100
"type": "git",

0 commit comments

Comments
 (0)