Skip to content

Commit 5b2614a

Browse files
author
Bogdan Abaev
committed
hookup mongodb container and my app
1 parent 9ae66f8 commit 5b2614a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CLI/CLI.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
const chalk = require('chalk')
21
const yargs = require('yargs')
32
const request = require('request')
43
const fs = require('fs');
5-
host = "http://localhost:4000";
4+
//host = "http://localhost:4000";
5+
host = "http://18.233.168.151:80";
66
path = "/Users/bogdanabaev/RandomProgramming/node/notes/CLI/"
77

8+
9+
// BUG: BREAKS WITH SIGNUP CAUSE THERE IS NO 'TIME' AFTER DATA
810
const sendQuery = function (query, username, signup) {
911
if (username) {
1012
request.post({
@@ -22,6 +24,7 @@ const sendQuery = function (query, username, signup) {
2224
if (signup) {
2325
fs.writeFileSync(path + '.username.txt', username);
2426
}
27+
console.log(result.body);
2528
const data = JSON.parse(result.body).data.time;
2629
const key = Object.keys(data)[0];
2730
console.log(data[`${key}`]);

server/mongoUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
const { MongoClient} = require('mongodb');
33

4-
const connectionUrl = process.env.DB_URL? process.env.DB_URL:'mongodb://mongo:27017/';
5-
//const connectionUrl = 'mongodb://127.0.0.1:27017';
4+
//const connectionUrl = process.env.DB_URL? process.env.DB_URL:'mongodb://mongo:27017/';
5+
const connectionUrl = 'mongodb://mongo:27017/';
66
const database = 'task_manager'
77
var db;
88
var dbClient;

0 commit comments

Comments
 (0)