feat: (broken) implement route map and address autocomplete widgets with associated infrastructure testing scripts

This commit is contained in:
ElPoyo
2026-06-05 11:10:32 +02:00
parent 8c01a21728
commit 21d7bc8b87
40 changed files with 21078 additions and 30 deletions
+31
View File
@@ -0,0 +1,31 @@
const axios = require('axios');
require('dotenv').config({ path: '.env' });
const { googleMapsComputeRoute } = require('./src/travel.js');
async function testToulouse() {
const origin = "25 Impasse du Puits du Suc, Saint-Martin-en-Haut, France";
const destination = "Toulouse, France";
const req = {
headers: { authorization: 'Bearer MOCK' },
body: { origin, destination, vehicleTollCategory: 2 }
};
let resultBody = null;
const res = {
set: () => {}, status: () => res,
json: (data) => { resultBody = data; return res; },
send: (data) => { resultBody = data; return res; }
};
const auth = require('./utils/auth');
auth.authenticateUser = async () => {};
await googleMapsComputeRoute(req, res);
if (resultBody.error) {
console.error(`Error: ${resultBody.error}`);
} else {
console.log(JSON.stringify(resultBody.routes[0], null, 2));
}
}
testToulouse();