mirror of
/repos/Prototyper.git
synced 2025-12-30 06:31:32 +01:00
configurable importer_path
This commit is contained in:
parent
04a770850d
commit
77d70a9d22
@ -164,7 +164,7 @@ module.exports = function (config, mongoInstance, sharemodel) {
|
||||
promises.push(
|
||||
helpers.replace(doc, import_file_tag, function (result, callback) {
|
||||
var parts = import_file_regexp.exec(result);
|
||||
var filename = path.resolve(config.public_path, parts[1]);
|
||||
var filename = path.resolve(config.importer_path, parts[1]);
|
||||
var context = {
|
||||
collection: parts[2],
|
||||
name: parts[3],
|
||||
|
||||
@ -319,7 +319,7 @@ module.exports = function (app, config) {
|
||||
var importerInstance = importer(config, mongodataInstance, model);
|
||||
|
||||
app.get('/importer/:filename', function importFile(req, res, next) {
|
||||
var filename = path.resolve(config.public_path, req.params.filename);
|
||||
var filename = path.resolve(config.importer_path, req.params.filename);
|
||||
config.debug && console.log('/importer/:filename', filename);
|
||||
fs.readFile(filename, 'utf-8', function (err, sub_doc) {
|
||||
if (err) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user