Skip to content

Commit

Permalink
Update env
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Saakian committed Mar 22, 2020
1 parent e49d101 commit 89c34fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
apps: [
{
name: 'Exchange bot',
name: 'exchange-bot',
script: './src/index.js',
instances: 2,
instances: 1,
autorestart: true,
watch: true,
exec_mode: 'cluster',
Expand All @@ -14,6 +14,7 @@ module.exports = {
env_production: {
NODE_ENV: 'production',
},
log_date_format: 'YYYY-MM-DD HH:mm Z',
},
],

Expand Down
4 changes: 2 additions & 2 deletions src/bot/bot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Telegraf = require('telegraf');
const Markup = require('telegraf/markup');
const { get, isEmpty } = require('lodash');
const { isEmpty } = require('lodash');
const { TOKEN } = require('../config/env');
const UsersModel = require('../models/Users');
const addMenus = require('./utils/addMenus');
Expand All @@ -11,7 +11,6 @@ const UserModel = require('../models/Users');
const execute = () => {
const bot = new Telegraf(TOKEN);
applyMiddlewares(bot);

bot.start(async ctx => {
const usersModel = new UsersModel();
const model = {
Expand Down Expand Up @@ -80,6 +79,7 @@ const execute = () => {
bot.on('text', async ctx =>
ctx.reply('Some wrong action! Please write something else.'),
);

bot.launch();
};

Expand Down
2 changes: 1 addition & 1 deletion src/config/env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path');
require('dotenv').config({ path: path.join(__dirname, '.env') });
require('dotenv').config({ path: path.join(__dirname, '../../.env') });

module.exports = {
DEBUG: process.env.DEBUG,
Expand Down

0 comments on commit 89c34fd

Please sign in to comment.