Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit f50fbbd

Browse files
feat: moved up entrypoint variable in config.json
1 parent d710784 commit f50fbbd

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

config/config.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,19 @@
55
"db": {
66
"host": "C:/GitHub/Basic-LDES-Server/sources/database.sqlite"
77
},
8+
"entrypoint": "https://apidg.gent.be/opendata/adlib2eventstream/v1/dmg/objecten",
89
"sources" : [
910

1011
{
1112
"route": "/ldes-replication",
12-
"sourceFile": "dist/sources/mySource",
13-
"entrypoint": "https://apidg.gent.be/opendata/adlib2eventstream/v1/dmg/objecten",
13+
"sourceFile": "dist/sources/mySource",
1414
"queryparam": "generatedAtTime"
1515
},
16-
{
17-
"route": "/crowdscan",
18-
"sourceFile": "dist/sources/crowdscanSource",
19-
"entrypoint": "https://production.crowdscan.be/dataapi/gent/gent_langemunt/data/5",
20-
"sensors": 1,
21-
"environment": "gent_langemunt",
22-
"usesImportPages":true,
23-
"importInterval": 5000
24-
},
2516
{
2617
"route": "/import",
2718
"sourceFile": "dist/sources/mySource-import",
2819
"usesImportPages": true,
2920
"importInterval": 5000,
30-
"entrypoint": "https://apidg.gent.be/opendata/adlib2eventstream/v1/dmg/objecten",
3121
"queryparam": "generatedAtTime"
3222
}
3323
]

sources/mySource.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const rdfParser = require("rdf-parse").default;
99

1010
export class mySource extends Source {
1111

12+
protected config: object;
13+
1214
constructor (config: object) {
1315
super(config);
1416
}

src/init/AppRunner.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ export class AppRunner {
3232
let route: String = element['route'];
3333
let locationOfSource = this.resolveFilePath(element['sourceFile']);
3434
let MySource = require(locationOfSource).mySource;
35-
//let mySource: Source = new MySource(config);
36-
let mySource: Source = new MySource(element);
35+
36+
let config = element;
37+
config['entrypoint'] = configuration['entrypoint'] || 'localhost';
38+
let mySource: Source = new MySource(config);
3739

3840
if (element['usesImportPages'] != null && element['usesImportPages']) {
3941
mySource.setDatabaseModel(db.createTable(element['route']));

0 commit comments

Comments
 (0)