Skip to content

Commit 7eb07a4

Browse files
committed
DATA_URL env variable
1 parent dd34041 commit 7eb07a4

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

app.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
}
1111
}, "redistogo", "mongolab"],
1212
"env": {
13-
"NODE_ENV": "production",
14-
"PORT": "3000"
13+
"DATA_URL": {
14+
"description": "URL to data in JSON",
15+
"required": false
16+
}
1517
},
1618
"logo": "https://pbs.twimg.com/profile_images/776731186026704896/t2BmYaxc.jpg",
1719
"repository": "https://github.com/itemsapi/starter",

src/routes.js

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ module.exports = function(app) {
126126

127127
return statusHelper.elasticsearch(url)
128128
.then(function(result) {
129+
130+
result.data_url = process.env.DATA_URL || 'https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/movies-processed.json';
129131
return res.render('installation/start', result);
130132
})
131133
})

views/installation/start.html.twig

+2-3
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@
7070
{% if step <= 2 %}
7171
<h3>1. First step</h3>
7272
<form method="POST" action="/add-data">
73-
<p>Put link with json data (items) here (i.e. copy that link <a href="https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/movies-processed.json" target="_blank">that</a> here)</p>
73+
<p>Put link with json data here (i.e. copy that link <a href="https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/movies-processed.json" target="_blank">that</a> here)</p>
7474
<div class="form-group">
75-
{#<label for="exampleInputEmail1">Url with json data</label>#}
76-
<input type="text" class="form-control" name="url" value="https://raw.githubusercontent.com/itemsapi/itemsapi-example-data/master/items/movies-processed.json" placeholder="url with json data">
75+
<input type="text" class="form-control" name="url" value="{{ data_url }}" placeholder="url with json data">
7776
</div>
7877
<p>or raw json data</p>
7978
<div class="form-group">

0 commit comments

Comments
 (0)