From a227f7f21b31e9309e31017a7a7f671bae7728fd Mon Sep 17 00:00:00 2001 From: rui hildt Date: Mon, 12 Oct 2020 11:22:32 +0200 Subject: [PATCH] Update deployed link and formatting --- README.md | 6 +- data/database_file.db3 | Bin 32768 -> 32768 bytes data/seeds/02-cities.js | 109 +++++++++++++------------ data/seeds/03-roads.js | 174 ++++++++++++++++++++-------------------- package-lock.json | 32 ++++---- 5 files changed, 160 insertions(+), 161 deletions(-) diff --git a/README.md b/README.md index e76a726..d9bdd56 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Find the the shortest path between different cities in Belgium with Dijkstra algorithm. - Deployed Frontend: https://dijkstra.ruihildt.xyz/ -- Deployed Backend: https://dijkstra-backend.herokuapp.com/ +- Deployed Backend: https://dijkstra-backend.ruihildt.xyz/ - Frontend Source: https://git.ruihildt.xyz/ruihildt/dijkstra-frontend @@ -16,7 +16,7 @@ ___ | id | unsigned integer | primary key, auto-increments, generated by database | | name | string | | -#### Get countries list +#### Get a list of all cities by country id **`GET /api/countries/:country_id`** ##### Response @@ -49,7 +49,7 @@ An array of json objects with a list of cities in the selected country with `nam | name | string | | | country_id | unsigned integer | foreign key referencing `countries.id` | -#### Get cities list +#### Get a list of all cities **`GET /api/cities`** ##### Response diff --git a/data/database_file.db3 b/data/database_file.db3 index 2d806fbff9d7142c8d662ba72809f9babd010b9c..773386d76ce25e9c426d72dad5e64707a83f760f 100644 GIT binary patch delta 227 zcmXBGF$}>#6adivyI$|#p`WA)Ld-VF%?63YC}tDE(4`V(cB_q;&F02vW;L75W-G4K zd)6{**}ehcq1lHpn+!WOGfJ0k3RIK7d`1gH@Z?r zXFAc5cC@9WD4 b3OCLS`uT)G?xw{6*?%SAx+_6=3V^r2!`~k3 delta 227 zcmXBIzYoDc6ae79yT0DL^W!lg#J?b6F&Kzlx{5`Ep_7De5^6JIH=CuSnbmAIo2}C8 z_T`IX5y#?K2X$%;LEWaKRuyFhR?A?%E*e+XU=~K0c86R-M=4= diff --git a/data/seeds/02-cities.js b/data/seeds/02-cities.js index 0532481..ed9a6d1 100644 --- a/data/seeds/02-cities.js +++ b/data/seeds/02-cities.js @@ -1,59 +1,58 @@ - -exports.seed = function(knex) { - return knex('cities').truncate() +exports.seed = function (knex) { + return knex('cities') + .truncate() .then(function () { return knex('cities').insert([ - { - "id": 1, - "name": 'bruges', - "country_id": 1 - }, - { - "id": 2, - "name": 'antwerp', - "country_id": 1 - }, - { - "id": 3, - "name": 'ghent', - "country_id": 1 - }, - { - "id": 4, - "name": 'mechelen', - "country_id": 1 - }, - { - "id": 5, - "name": 'brussels', - "country_id": 1 - }, - { - "id": 6, - "name": 'mons', - "country_id": 1 - }, - { - "id": 7, - "name": 'namur', - "country_id": 1 - }, - { - "id": 8, - "name": 'liege', - "country_id": 1 - }, - { - "id": 9, - "name": 'arlon', - "country_id": 1 - }, - { - "id": 10, - "name": 'tournai', - "country_id": 1 - }, - + { + id: 1, + name: 'bruges', + country_id: 1, + }, + { + id: 2, + name: 'antwerp', + country_id: 1, + }, + { + id: 3, + name: 'ghent', + country_id: 1, + }, + { + id: 4, + name: 'mechelen', + country_id: 1, + }, + { + id: 5, + name: 'brussels', + country_id: 1, + }, + { + id: 6, + name: 'mons', + country_id: 1, + }, + { + id: 7, + name: 'namur', + country_id: 1, + }, + { + id: 8, + name: 'liege', + country_id: 1, + }, + { + id: 9, + name: 'arlon', + country_id: 1, + }, + { + id: 10, + name: 'tournai', + country_id: 1, + }, ]); - }); + }); }; diff --git a/data/seeds/03-roads.js b/data/seeds/03-roads.js index aa2b9de..eb8dbc4 100644 --- a/data/seeds/03-roads.js +++ b/data/seeds/03-roads.js @@ -1,92 +1,92 @@ - -exports.seed = function(knex) { - return knex('roads').truncate() +exports.seed = function (knex) { + return knex('roads') + .truncate() .then(function () { return knex('roads').insert([ { - "id": 1, - "start_city_id": 1, - "end_city_id": 3, - "distance": 50 - }, - { - "id": 2, - "start_city_id": 3, - "end_city_id": 10, - "distance": 80 - }, - { - "id": 3, - "start_city_id": 10, - "end_city_id": 5, - "distance": 89 - }, - { - "id": 4, - "start_city_id": 3, - "end_city_id": 5, - "distance": 56 - }, - { - "id": 5, - "start_city_id": 3, - "end_city_id": 2, - "distance": 60 - }, - { - "id": 6, - "start_city_id": 2, - "end_city_id": 4, - "distance": 25 - }, - { - "id": 7, - "start_city_id": 4, - "end_city_id": 5, - "distance": 27 - }, - { - "id": 8, - "start_city_id": 5, - "end_city_id": 6, - "distance": 80 - }, - { - "id": 9, - "start_city_id": 6, - "end_city_id": 7, - "distance": 91 - }, - { - "id": 10, - "start_city_id": 6, - "end_city_id": 10, - "distance": 51 - }, - { - "id": 11, - "start_city_id": 7, - "end_city_id": 9, - "distance": 129 - }, - { - "id": 12, - "start_city_id": 9, - "end_city_id": 7, - "distance": 123 - }, - { - "id": 13, - "start_city_id": 8, - "end_city_id": 7, - "distance": 65 - }, - { - "id": 14, - "start_city_id": 8, - "end_city_id": 5, - "distance": 97 - } + id: 1, + start_city_id: 1, + end_city_id: 3, + distance: 40, + }, + { + id: 2, + start_city_id: 3, + end_city_id: 10, + distance: 60, + }, + { + id: 3, + start_city_id: 10, + end_city_id: 5, + distance: 70, + }, + { + id: 4, + start_city_id: 3, + end_city_id: 5, + distance: 50, + }, + { + id: 5, + start_city_id: 3, + end_city_id: 2, + distance: 50, + }, + { + id: 6, + start_city_id: 2, + end_city_id: 4, + distance: 20, + }, + { + id: 7, + start_city_id: 4, + end_city_id: 5, + distance: 20, + }, + { + id: 8, + start_city_id: 5, + end_city_id: 6, + distance: 50, + }, + { + id: 9, + start_city_id: 6, + end_city_id: 7, + distance: 60, + }, + { + id: 10, + start_city_id: 6, + end_city_id: 10, + distance: 40, + }, + { + id: 11, + start_city_id: 7, + end_city_id: 9, + distance: 110, + }, + { + id: 12, + start_city_id: 9, + end_city_id: 7, + distance: 110, + }, + { + id: 13, + start_city_id: 8, + end_city_id: 7, + distance: 50, + }, + { + id: 14, + start_city_id: 8, + end_city_id: 5, + distance: 90, + }, ]); - }); + }); }; diff --git a/package-lock.json b/package-lock.json index f9ae435..f6a4c37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -763,9 +763,9 @@ "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" }, "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", "dev": true, "requires": { "is-obj": "^1.0.0" @@ -1826,9 +1826,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, "lowercase-keys": { "version": "1.0.1", @@ -1946,9 +1946,9 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minipass": { "version": "2.9.0", @@ -1987,11 +1987,11 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "ms": { @@ -2471,9 +2471,9 @@ }, "dependencies": { "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" } } },