GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — changes :moyai: · guillecro/fullstack-javascript@5db52d6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • 10-db-connect-heroku
    • Procfile
    • app.js
    • package.json
  • 11-db
    • Procfile
    • app.js
    • collections.js
    • package.json
  • 9-db-connect
    • app.js
    • package.json
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎10-db/Procfile‎ ‎10-db-connect-heroku/Procfile‎10-db/Procfile renamed to 10-db-connect-heroku/Procfile

Copy file name to clipboard
File renamed without changes.
Collapse file

‎10-db-connect-heroku/app.js‎

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var util = require('util')
2+
var url = require('url')
3+
var client = require ('mongodb').MongoClient
4+
5+
// Script that will work on Heroku with MongoLab
6+
7+
var dbConnUrl = process.env.MONGOLAB_URI ||
8+
'mongodb://127.0.0.1:27017/test'
9+
10+
11+
console.log('db server: ', dbConnUrl)
12+
13+
client.connect(dbConnUrl, {}, function(error, db) {
14+
console.log('error: ', error)
15+
db.listCollections().toArray(function(err, collections) {
16+
console.log('error: ', error)
17+
console.log('collections: ', collections)
18+
db.close()
19+
})
20+
})
Collapse file

‎10-db-connect-heroku/package.json‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "node-example",
3+
"version": "0.0.1",
4+
"dependencies": {
5+
"mongodb": "2.0.49",
6+
"url": "0.11.0"
7+
},
8+
"main": "app.js",
9+
"engines": {
10+
"node": ">=0.6.x"
11+
}
12+
}
Collapse file

‎9-db-connect/Procfile‎ ‎11-db/Procfile‎9-db-connect/Procfile renamed to 11-db/Procfile

Copy file name to clipboard
File renamed without changes.
Collapse file

‎10-db/app.js‎ ‎11-db/app.js‎10-db/app.js renamed to 11-db/app.js

Copy file name to clipboard
File renamed without changes.
Collapse file

‎10-db/collections.js‎ ‎11-db/collections.js‎10-db/collections.js renamed to 11-db/collections.js

Copy file name to clipboard
File renamed without changes.
Collapse file

‎10-db/package.json‎ ‎11-db/package.json‎10-db/package.json renamed to 11-db/package.json

Copy file name to clipboard
File renamed without changes.
Collapse file

‎9-db-connect/db.js‎ ‎9-db-connect/app.js‎9-db-connect/db.js renamed to 9-db-connect/app.js

Copy file name to clipboardExpand all lines: 9-db-connect/app.js
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ var Server = mongodb.Server
66
var host = '127.0.0.1'
77
var port = 27017
88

9-
// Script that will work on Heroku with MongoHQ/Compose
10-
11-
/*
12-
var dbConnUrl = process.env.MONGOHQ_URL ||
13-
'mongodb://127.0.0.1:27017'
14-
var host = url.parse(dbConnUrl).hostname
15-
var port = new Number(url.parse(dbConnUrl).port)
16-
*/
17-
189
var db=new Db ('test', new Server(host, port, {}))
1910
db.open(function(error, connection){
2011
console.log('error: ', error)
Collapse file

‎9-db-connect/package.json‎

Copy file name to clipboardExpand all lines: 9-db-connect/package.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"mongodb": "2.0.49",
66
"url": "0.11.0"
77
},
8+
"main": "app.js",
89
"engines": {
910
"node": ">=0.6.x"
1011
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.