Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use absolute path to write to news image directory

  • Loading branch information...
commit 180d5ca0e4479fa4b1904289dd4f3e089ad4f264 1 parent 4900e3f
Joshua Davis authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  indexer/crawler.js
3  indexer/crawler.js
View
@@ -7,7 +7,6 @@ var crypto = require('crypto');
var url = require('url');
var fs = require('fs');
-
var articleSchema = require('../server/schemas/article.js');
var config = require('./indexer.json');
var appConfig = require('../config.json');
@@ -105,7 +104,7 @@ function saveImage(articleImageUrl) {
var filename = generateImageFileName(articleImageUrl);
try {
http.get(articleImageUrl, function(response) {
- response.pipe(fs.createWriteStream(appConfig.newsImageDir + "/" + filename));
+ response.pipe(fs.createWriteStream(__dirname + "/../" + appConfig.newsImageDir + "/" + filename));
});
} catch (exception) {
console.log(exception.toString());
Please sign in to comment.
Something went wrong with that request. Please try again.