diff --git a/.env b/.env deleted file mode 100644 index 9e8e7cf..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -GOOGLE_API_KEY=AIzaSyAaVfXbFPUQSeif2FwY1gQ2iJaBp9ZPdPM \ No newline at end of file diff --git a/.gitignore b/.gitignore index 52962c2..f15f8f1 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,5 @@ profile-* profile* *clinic* *flamegraph* + +.env diff --git a/index.js b/index.js index 1d05a2d..d42f8b6 100644 --- a/index.js +++ b/index.js @@ -81,6 +81,10 @@ app.use('/rep', async (req, res) => { } } + if (!circoForeign) { + throw new Error('Error trying to parse this country : ' + countryName) + } + // If a code is found, send the associated file containing the representant data const repFile = readFileSync(join(__dirname, `public/reps/${lookupTable[circoForeign]}.json`), 'utf-8') res.end(repFile) diff --git a/rep-lookup-foreign.js b/rep-lookup-foreign.js index 391d093..cafca08 100644 --- a/rep-lookup-foreign.js +++ b/rep-lookup-foreign.js @@ -84,7 +84,7 @@ module.exports = { "Slovakia", ], "099-08": [ - "Italia", + "Italy", "Malta", "San Marino", "Holy See", @@ -147,7 +147,7 @@ module.exports = { "São Tomé and Príncipe", "Angola", "Congolese", - "Democratic Republic of Congo", + "Democratic Republic of the Congo", "Iraq", "Jordan", "Lebanon",