Skip to content

Commit 47224bf

Browse files
committed
Add COPY as an ONDBUILD command
1 parent 175cbb7 commit 47224bf

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
FROM semtech/mu-javascript-template:1.0.0
22

33
MAINTAINER Erika Pauwels <erika.pauwels@gmail.com>
4+
5+
ONBUILD COPY export.js /config/export.js

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ Export service
44
Microservice to export data using custom defined SPARQL queries.
55

66
## Using the template
7-
Extend `semtech/mu-export-service` service and add an export configuration in `/config/export.js`.
7+
Extend `semtech/mu-export-service` and provide an export configuration in `export.js`.
88

99
## Example Dockerfile
1010

1111
```
1212
FROM semtech/mu-export-service:0.3.0
1313
MAINTAINER Erika Pauwels <erika.pauwels@gmail.com>
14-
15-
COPY export.js /config/export.js
16-
1714
```
1815

1916
## Export configuration
@@ -33,7 +30,7 @@ export default [
3330

3431
```
3532

36-
An export configuration object consists of the following properties:
33+
Each element in the array will become an API endpoint in the microservice. An export configuration object consists of the following properties:
3734
* [REQUIRED] `path`: endpoint on which the export will be exposed
3835
* [REQUIRED] `format`: format of the export (`application/json`, `text/csv`, `text/turtle`, etc.)
3936
* [REQUIRED] `query`: the SPARQL query to execute. This may be a `SELECT` or a `CONSTRUCT` query.

template.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
export default function template(strings, ...keys) {
2-
return (function(...values) {
3-
var dict = values[values.length - 1] || {};
2+
return (function(values) {
43
var result = [strings[0]];
54
keys.forEach(function(key, i) {
6-
var value = Number.isInteger(key) ? values[key] : dict[key];
5+
var value = values[key];
76
result.push(value, strings[i + 1]);
87
});
98
return result.join('');

0 commit comments

Comments
 (0)