-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
40 lines (33 loc) · 1.51 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const EcouteurDomibus = require('./src/ecouteurDomibus');
const OOTS_FRANCE = require('./src/ootsFrance');
const AdaptateurDomibus = require('./src/adaptateurs/adaptateurDomibus');
const adaptateurEnvironnement = require('./src/adaptateurs/adaptateurEnvironnement');
const adaptateurUUID = require('./src/adaptateurs/adaptateurUUID');
const horodateur = require('./src/adaptateurs/horodateur');
const transmetteurPiecesJustificatives = require('./src/adaptateurs/transmetteurPiecesJustificatives');
const DepotPointsAcces = require('./src/depots/depotPointsAcces');
const DepotRequeteurs = require('./src/depots/depotRequeteurs');
const DepotServicesCommuns = require('./src/depots/depotServicesCommunsLocal');
const adaptateurDomibus = AdaptateurDomibus({ adaptateurUUID, horodateur });
const depotPointsAcces = new DepotPointsAcces(adaptateurDomibus);
const depotRequeteurs = new DepotRequeteurs();
const depotServicesCommuns = new DepotServicesCommuns();
const ecouteurDomibus = new EcouteurDomibus({ adaptateurDomibus, intervalleEcoute: 1000 });
const serveur = OOTS_FRANCE.creeServeur({
adaptateurDomibus,
adaptateurEnvironnement,
adaptateurUUID,
depotPointsAcces,
depotRequeteurs,
depotServicesCommuns,
ecouteurDomibus,
horodateur,
transmetteurPiecesJustificatives,
});
const port = process.env.PORT || 3000;
serveur.ecoute(port, () => {
/* eslint-disable no-console */
console.log(`OOTS-France est démarré et écoute le port ${port} !…`);
/* eslint-enable no-console */
});
ecouteurDomibus.ecoute();