mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Moved files to config folders, and updated pm2 command
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,7 +1,7 @@
|
||||
server/public/assets/images/thumbnails/
|
||||
server/mailconfig.js
|
||||
server/mongo_config.js
|
||||
server/cert_config.js
|
||||
server/config/mailconfig.js
|
||||
server/config/mongo_config.js
|
||||
server/config/cert_config.js
|
||||
*/node_modules
|
||||
node_modules/
|
||||
scripts/
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
var readline = require('readline');
|
||||
var mongojs = require('mongojs');
|
||||
var db = mongojs.connect('mydb');
|
||||
|
||||
|
||||
var rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
});
|
||||
|
||||
rl.question("Channel to pin: ", function(coll) {
|
||||
// TODO: Log the answer in a database
|
||||
db.collection("frontpage_lists").update({pinned:1}, {$set:{pinned:0}}, function(err, resp){
|
||||
db.collection("frontpage_lists").update({_id:coll}, {$set:{pinned:1}}, function(err, resp){
|
||||
console.log("Changed pinned channel to: " + coll);
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
rl.close();
|
||||
});
|
||||
5
server/config/mongo_config.example.js
Normal file
5
server/config/mongo_config.example.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var mongo_config = {
|
||||
config: 'mydb'
|
||||
};
|
||||
|
||||
module.exports = mongo_config;
|
||||
@@ -1,6 +1,7 @@
|
||||
var mongo_db_cred = {config: 'mydb'};
|
||||
var path = require('path');
|
||||
var mongo_config = require(path.join(path.join(__dirname, '../config/'), 'mongo_config.js'));
|
||||
var mongojs = require('mongojs');
|
||||
var db = mongojs(mongo_db_cred.config);
|
||||
var db = mongojs(mongo_config.config);
|
||||
|
||||
db.collection("chat_logs").createIndex({ "createdAt": 1 }, { expireAfterSeconds: 600 });
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ pathThumbnails = __dirname;
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
var exphbs = require('express-handlebars');
|
||||
var cert_config = require('./cert_config.js');
|
||||
console.log(path.join(__dirname, 'config'));
|
||||
var cert_config = require(path.join(path.join(__dirname, 'config'), 'cert_config.js'));
|
||||
var hbs = exphbs.create({
|
||||
defaultLayout: publicPath + '/layouts/main',
|
||||
layoutsDir: publicPath + '/layouts',
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"apps" : [{
|
||||
"name" : "zoff",
|
||||
"script" : "./server.js",
|
||||
"script" : "./index.js",
|
||||
"watch" : true,
|
||||
"ignore_watch": ["node_modules", "views/assets/images/thumbnails"],
|
||||
"ignore_watch": ["node_modules", "public/assets/images/thumbnails"],
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
const path = require('path');
|
||||
var path = require('path');
|
||||
var nodemailer = require('nodemailer');
|
||||
var mailconfig = require('../mailconfig.js');
|
||||
var mailconfig = require(path.join(__dirname, '../config/mailconfig.js'));
|
||||
var mongo_db_cred = {config: 'mydb'};
|
||||
var mongojs = require('mongojs');
|
||||
var db = mongojs(mongo_db_cred.config);
|
||||
|
||||
Reference in New Issue
Block a user