Extract TaM simulation from front and TaM data from back

This commit is contained in:
Mattéo Delabre 2020-07-19 22:13:26 +02:00
parent 0d7b384821
commit 476a0787a1
Signed by: matteo
GPG Key ID: AE3FBD02DC583ABB
15 changed files with 9 additions and 9 deletions

View File

@ -4,8 +4,8 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"back": "node back", "back": "node src/back",
"front": "parcel serve front/index.html", "front": "parcel serve src/front/index.html",
"lint": "eslint ." "lint": "eslint ."
}, },
"keywords": [], "keywords": [],

View File

@ -1,6 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
const network = require('../back/data/network'); const network = require('../src/tam/network');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
@ -10,7 +10,7 @@ const fs = require('fs');
const data = await network.fetch(lines); const data = await network.fetch(lines);
fs.writeFileSync( fs.writeFileSync(
path.join(__dirname, '../back/data/network.json'), path.join(__dirname, '../src/tam/network.json'),
JSON.stringify( JSON.stringify(
data, data,
(_, value) => (_, value) =>

View File

@ -1,7 +1,7 @@
const express = require('express'); const express = require('express');
const util = require('./util'); const util = require('../util');
const realtime = require('./data/realtime'); const realtime = require('../tam/realtime');
const app = express(); const app = express();
const port = 4321; const port = 4321;

View File

@ -2,6 +2,6 @@ require('regenerator-runtime/runtime');
const {createMap} = require('./map'); const {createMap} = require('./map');
require('./data'); require('../tam/simulation');
createMap(/* map = */ 'map'); createMap(/* map = */ 'map');

View File

@ -21,7 +21,7 @@ const color = require('color');
const mapboxToken = `pk.eyJ1IjoibWF0dGVvZGVsYWJyZSIsImEiOiJja2NxaTUyMmUwcmFhMn\ const mapboxToken = `pk.eyJ1IjoibWF0dGVvZGVsYWJyZSIsImEiOiJja2NxaTUyMmUwcmFhMn\
h0NmFsdzQ3emxqIn0.cyxF0h36emIMTk3cc4VqUw`; h0NmFsdzQ3emxqIn0.cyxF0h36emIMTk3cc4VqUw`;
const network = require('../back/data/network.json'); const network = require('../tam/network.json');
const makeDataSources = async () => const makeDataSources = async () =>
{ {

View File

@ -1,5 +1,5 @@
const axios = require('axios'); const axios = require('axios');
const network = require('../back/data/network.json'); const network = require('./network.json');
const server = 'http://localhost:4321'; const server = 'http://localhost:4321';