Commit 3e11c2cf authored by yPhil's avatar yPhil
Browse files

Merge branch 'yarn'

parents 6bb6a778 760c463e
Pipeline #327921 passed with stage
in 1 minute and 18 seconds
......@@ -37,3 +37,4 @@ jspm_packages
# Misc
tmp
package-lock.json
cert
......@@ -3,10 +3,33 @@
var app = require('../app');
var debug = require('debug')('petrolette:server');
var http = require('http');
const fs = require('fs');
var port = normalizePort(process.env.PORT || '8000');
app.set('port', port);
function isLocal() {
switch( window.location.protocol ) {
case 'file:':
return true;
default:
return false;
}
}
var port = normalizePort(process.env.PORT || '8080');
app.set('port', port);
console.log('ENV: ' + process.env.NODE_ENV);
// if (!isLocal) {
// const options = {
// cert: fs.readFileSync('../cert/fullchain.pem'),
// key: fs.readFileSync('../cert/privkey.pem')
// };
// } else {
// const options
// }
// const options = isLocal() ? '' : {cert: fs.readFileSync('../cert/fullchain.pem'), key: fs.readFileSync('../cert/privkey.pem')};
var server = http.createServer(app);
......
......@@ -13,10 +13,11 @@
},
"scripts": {
"start": "pm2 start pm2.config.json",
"start-ssl": "pm2 start pm2.config.json --env ssl",
"restart": "pm2 restart pm2.config.json",
"stop": "pm2 stop ptl",
"show": "pm2 show ptl",
"logs": "pm2 logs ptl",
"stop": "pm2 stop petrolette",
"show": "pm2 show petrolette",
"log": "pm2 logs petrolette",
"postinstall": "bower install"
},
"dependencies": {
......
{
"apps" : [{
"name" : "ptl",
"script" : "./bin/www",
"watch" : true,
"ignore_watch" : ["#*", "favicons-cache", ".git", "node_modules"],
"log_date_format" : "YYYY-MM-DD HH:mm",
"env" : {
"PORT" : 8000,
"FAVICONS_CACHE_DIR": "favicons-cache"
},
"env_production" : {
"NODE_ENV": "production"
"apps" : [
{
"name" : "petrolette",
"script" : "./bin/www",
"watch" : true,
"ignore_watch" : ["#*", "favicons-cache", ".git", "node_modules"],
"log_date_format" : "YYYY-MM-DD HH:mm",
"env" : {
"PORT" : 8080,
"NODE_ENV": "dev",
"FAVICONS_CACHE_DIR": "favicons-cache"
},
"env_ssl" : {
"PORT" : 8080,
"NODE_ENV": "ssl",
"FAVICONS_CACHE_DIR": "favicons-cache"
}
}
}]
]
}
......@@ -260,6 +260,9 @@ PTL.feed = {
$.each(data.feedItems, function(index, item) {
// PTL.util.console('PLOP', 'warning');
if (index == parseInt(feedLimit)) return false;
// console.log('i: (%s)', JSON.stringify(item));
......@@ -326,7 +329,15 @@ PTL.feed = {
}
if (typeof item.enclosures[0] !== 'undefined' && item.enclosures[0].url) {
if (!imageUrl && imgTypes.indexOf(item.enclosures[0].type) > -1) {
if (item.enclosures[0].url && item.enclosures[0].url.endsWith(".jpg")) {
console.log('Wopop on %s!: (%s) imageUrl: %s', feedUrl, item.enclosures[0].url, imageUrl);
imageUrl = item.enclosures[0].url;
}
if (imgTypes.indexOf(item.enclosures[0].type) > -1) {
imageUrl = item.enclosures[0].url;
}
......
......@@ -117,7 +117,7 @@ function getFeed (urlfeed, callback) {
})
.on ('error', function (err) {
var meta = this.meta;
console.log('HUM (%s)', err, meta.title);
console.log('HUUM (%s) %s %s', err, meta.title, urlfeed);
// callback ('err');
})
.on ('end', function () {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment