Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var mongoose = require('mongoose'),
- fs = require('fs'),
- express = require('express');
- mongoose.set('debug', true);
- // Bootstrap db connection
- var db = mongoose.connect('mongodb://localhost/test', {
- options: {
- ssl: true,
- port: 27017,
- user: 'xxxxxxxx',
- pass: 'xxxxxxxx_',
- sslValidate: false,
- checkServerIdentity: false,
- sslCA: fs.readFileSync('./config/sslcerts/mongodb.pem'),
- sslCert: fs.readFileSync('./config/sslcerts/mongodb-cert.crt'),
- sslKey: fs.readFileSync('./config/sslcerts/mongodb-cert.key'),
- sslPass: 'xxxxxx'
- },
- },
- function(err) {
- console.error('Could not connect to MongoDB!');
- console.log(err);
- });
- // Init the express application
- var app = require('express')(db);
- app.listen(8443);
- console.log('MEAN.JS application started on port ' + 8443);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement