|
@@ -2,10 +2,19 @@ const app = require('../app');
|
|
|
const db = require('../model/db');
|
|
|
const createFolderIsExist = require('../helpers/create-directory');
|
|
|
const PORT = process.env.PORT || 3000;
|
|
|
-const BASE_URL = process.env.BASE_URL;
|
|
|
+const APP_NAME = process.env.APP_NAME;
|
|
|
+const http = require('http');
|
|
|
|
|
|
setInterval(() => {
|
|
|
- http.get(`${BASE_URL}`);
|
|
|
+ http
|
|
|
+ .get(`http://${APP_NAME}.herokuapp.com`, function (res) {
|
|
|
+ res.on('data', function (_chunk) {
|
|
|
+ console.log('HEROKU RESPONSE: PINGED EVERY 25 MINUTES');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .on('error', function (_err) {
|
|
|
+ console.log('HEROKU RESPONSE: NOT PINGED');
|
|
|
+ });
|
|
|
}, 25 * 60 * 1000);
|
|
|
|
|
|
db.then(() => {
|