diff --git a/lib/models/post.js b/lib/models/post.js index 1c4ee91..39febca 100644 --- a/lib/models/post.js +++ b/lib/models/post.js @@ -1,7 +1,10 @@ /* post model for mongoose */ +var url = require('url'); +var elasticConnection = url.parse(process.env.BONSAI_URL || 'http://localhost:9200'); +console.log('BONSAI_URL = ' + process.env.BONSAI_URL); var mongoose = require('mongoose'); var mongoosastic = require('mongoosastic'); var Schema = mongoose.Schema; @@ -16,5 +19,8 @@ var postSchema = new Schema({ tags: {type: String, es_indexed:true} }); -postSchema.plugin(mongoosastic); +postSchema.plugin(mongoosastic, { + host: elasticConnection.host, + port: elasticConnection.port +}); mongoose.model('postModel', postSchema); \ No newline at end of file diff --git a/views/error.ejs b/views/error.ejs index 1976f2e..2fd99ff 100644 --- a/views/error.ejs +++ b/views/error.ejs @@ -18,6 +18,15 @@ +