Skip to content

Commit 249d72f

Browse files
committed
Renaming config
1 parent e635944 commit 249d72f

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AnyFetch Hydrater for classic office files
66
# How to install?
77
```sh
88
sudo apt-get install python-software-properties
9-
sudo apt-add-repository ppa:libreoffice/libreoffice-4-1
9+
sudo apt-add-repository ppa:libreoffice/libreoffice-4-2
1010
sudo apt-get update
1111
sudo apt-get install libreoffice -y
1212
npm install

Diff for: config/configuration.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,26 @@
44

55
// node_env can either be "development" or "production"
66
var node_env = process.env.NODE_ENV || "development";
7-
var default_port = 8000;
8-
9-
var default_office_version = "4.0";
7+
var defaultPort = 8000;
108

119
// URL of pdf hydrater
12-
var default_pdf_hydrater_url = "http://pdf.hydrater.anyfetch.com";
10+
var defaultPdfHydraterUrl = "http://pdf.hydrater.anyfetch.com";
1311

1412
// URL of office hydrater
15-
var default_office_hydrater_url = 'http://office.hydrater.anyfetch.com';
13+
var defaultOfficeHydraterUrl = 'http://office.hydrater.anyfetch.com';
1614

1715
// Number of office instance to run simultaneously per cluster
18-
var default_concurrency = 1;
16+
var defaultConcurrency = 1;
1917

2018
if(node_env === "production") {
21-
default_port = 80;
19+
defaultPort = 80;
2220
}
2321

2422
// Exports configuration
2523
module.exports = {
2624
env: node_env,
27-
port: process.env.PORT || default_port,
28-
office_version: process.env.OFFICE_VERSION || default_office_version,
29-
concurrency: process.env.OFFICE_CONCURRENCY || default_concurrency,
30-
pdf_hydrater_url: process.env.PDF_HYDRATER_URL || default_pdf_hydrater_url,
31-
office_hydrater_url: process.env.OFFICE_HYDRATER_URL || default_office_hydrater_url
25+
port: process.env.PORT || defaultPort,
26+
concurrency: process.env.OFFICE_CONCURRENCY || defaultConcurrency,
27+
pdfHydraterUrl: process.env.PDF_HYDRATER_URL ||defaultPdfHydraterUrl,
28+
officeHydraterUrl: process.env.OFFICE_HYDRATER_URL || defaultOfficeHydraterUrl
3229
};

Diff for: lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ module.exports = function(path, document, changes, cb) {
9999
pdfDocument.metadata.path = document.metadata.path;
100100

101101
var payload = {
102-
url: config.pdf_hydrater_url + "/hydrate",
102+
url: config.pdfHydraterUrl + "/hydrate",
103103
json{
104-
file_path: config.office_hydrater_url + "/document?path=" + pdfFile.replace('/tmp/', ''),
104+
file_path: config.officeHydraterUrl + "/document?path=" + pdfFile.replace('/tmp/', ''),
105105
callback: finalCb.urlCallback,
106106
document: pdfDocument
107107
}

Diff for: test/server.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ describe('Test office results', function() {
2222
it('should call the pdf hydrater before sending results', function(done) {
2323
// Update our pdf hydrater
2424
officeHydrater.listen(1339);
25-
config.pdf_hydrater_url = 'http://localhost:1337';
26-
config.office_hydrater_url = 'http://localhost:1339';
25+
config.pdfHydraterUrl = 'http://localhost:1337';
26+
config.officeHydraterUrl = 'http://localhost:1339';
2727

2828
var pdfHydrater = restify.createServer();
2929
pdfHydrater.use(restify.queryParser());
@@ -92,8 +92,8 @@ describe('Test office results', function() {
9292

9393
it('should transform to PDF', function(done) {
9494
// Update our pdf hydrater
95-
config.pdf_hydrater_url = 'http://localhost:1337';
96-
config.office_hydrater_url = 'http://localhost:1339';
95+
config.pdfHydraterUrl = 'http://localhost:1337';
96+
config.officeHydraterUrl = 'http://localhost:1339';
9797

9898
var pdfHydrater = restify.createServer();
9999
pdfHydrater.use(restify.queryParser());

0 commit comments

Comments
 (0)