Skip to content

Commit 89fd01c

Browse files
committed
Add db.config file using environment variables set via hosting provider
1 parent dda9dfc commit 89fd01c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ lib-cov
66
*.out
77
*.pid
88
*.gz
9-
db.config
109

1110
pids
1211
logs

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
This repo contains the Red Pill Web Masons' Node.js web server (and the files it serves). This web server is live at http://ayoshitake.com.
22

3-
This repo is complete except for a single file - modules/db.config - which holds database credentials. This file can be obtained from me by <a href="mailto:airandfingers@gmail.com">asking nicely</a>.
4-
53
#Testing
64
Tests using [Mocha](https://github.com/visionmedia/mocha), [Chai](https://github.com/visionmedia/mocha), and [SuperTest](https://github.com/visionmedia/supertest):
75

modules/db.config

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
DB_HOST: process.env.MONGO_HOST
3+
, DB_PORT: process.env.MONGO_PORT
4+
, DB_NAME: process.env.MONGO_NAME
5+
, DB_USER: process.env.MONGO_USER
6+
, DB_PASSWORD: process.env.MONGO_PASSWORD
7+
8+
, SESSION_SECRET: process.env.SESSION_SECRET
9+
};
10+
11+
//command line commands:
12+
13+
//connect to DB:
14+
//mongo [DB_HOST]:[DB_PORT]/[DB_NAME] -u [DB_USER] -p [DB_PASSWORD]
15+
16+
//import into DB from file
17+
//mongoimport -h [DB_HOST]:[DB_PORT] -d [DB_NAME] -u [DB_USER] -p [DB_PASSWORD] -c [collection_name] [file.json]
18+
19+
//export from DB into file
20+
//mongoexport -h [DB_HOST]:[DB_PORT] -d [DB_NAME] -u [DB_USER] -p [DB_PASSWORD] -c [collection_name] > [file.json]

0 commit comments

Comments
 (0)