Last active
December 30, 2015 22:49
-
-
Save jamlfy/7897132 to your computer and use it in GitHub Desktop.
Exportación
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connect = function ( config ){ | |
this.db = mongo.createConnection( config.url ); | |
}; | |
// Mis metodos.. | |
// y mas funciones necesarias | |
exports.Connect = connect; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Iniciando proceso | |
GLOBAL.connection = require('./file_1.js'); | |
GLOBAL.db = new connection.Connect( 'mongo://localhost:2781/MiDB' ); | |
var routes = require('./file_method.js'); | |
var express = require('express'); | |
var app = express(); | |
// Metodo de uso | |
// db.collection... | |
app.post('/upload', routes.upload); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.upload = funciton(res, req){ | |
db.collection(..); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment