-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
21 lines (16 loc) · 25.5 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from flask import Flask, request, jsonify
from flask_cors import cross_origin, CORS
app = Flask(__name__)
CORS(app)
db = [["Nigeriya", "Abuca", "https://upload.wikimedia.org/wikipedia/commons/7/79/Flag_of_Nigeria.svg"], ["Pitkern adaları", "Adamstaun", "https://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_the_Pitcairn_Islands.svg"], ["Yunanıstan", "Afina", "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_Greece.svg"], ["Qana", "Akkra", "https://upload.wikimedia.org/wikipedia/commons/1/19/Flag_of_Ghana.svg"], ["Niue", "Alofi", "https://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_Niue.svg"], ["Niderland", "Amsterdam (rəsmi), Haaqa (inzibati, qanunverici və məhkəmə)", "https://upload.wikimedia.org/wikipedia/commons/2/20/Flag_of_the_Netherlands.svg"], ["Andorra", "Andorra la Vella", "https://upload.wikimedia.org/wikipedia/commons/1/19/Flag_of_Andorra.svg"], ["Türkiyə", "Ankara", "https://upload.wikimedia.org/wikipedia/commons/b/b4/Flag_of_Turkey.svg"], ["Madaqaskar", "Antananarivu", "https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Madagascar.svg"], ["Samoa", "Apia", "https://upload.wikimedia.org/wikipedia/commons/3/31/Flag_of_Samoa.svg"], ["Qazaxıstan", "Astana", "https://upload.wikimedia.org/wikipedia/commons/d/d3/Flag_of_Kazakhstan.svg"], ["Paraqvay", "Asunson", "https://upload.wikimedia.org/wikipedia/commons/2/27/Flag_of_Paraguay.svg"], ["Türkmənistan", "Aşqabad", "https://upload.wikimedia.org/wikipedia/commons/1/1b/Flag_of_Turkmenistan.svg"], ["Kuk adaları", "Avarua", "https://upload.wikimedia.org/wikipedia/commons/3/35/Flag_of_the_Cook_Islands.svg"], ["İraq", "Bağdad", "https://upload.wikimedia.org/wikipedia/commons/f/f6/Flag_of_Iraq.svg"], ["Azərbaycan", "Bakı", "https://upload.wikimedia.org/wikipedia/commons/d/dd/Flag_of_Azerbaijan.svg"], ["Mali", "Bamako", "https://upload.wikimedia.org/wikipedia/commons/9/92/Flag_of_Mali.svg"], ["Qambiya", "Banjul", "https://upload.wikimedia.org/wikipedia/commons/7/77/Flag_of_The_Gambia.svg"], ["Bruney", "Bandar Səri Bəgavan", "https://upload.wikimedia.org/wikipedia/commons/9/9c/Flag_of_Brunei.svg"], ["Tailand", "Banqkok", "https://upload.wikimedia.org/wikipedia/commons/a/a9/Flag_of_Thailand.svg"], ["MAR", "Bangi", "https://upload.wikimedia.org/wikipedia/commons/6/6f/Flag_of_the_Central_African_Republic.svg"], ["Sent-Kits və Nevis", "Baster", "https://upload.wikimedia.org/wikipedia/commons/f/fe/Flag_of_Saint_Kitts_and_Nevis.svg"], ["Beliz", "Belmopan", "https://upload.wikimedia.org/wikipedia/commons/e/e7/Flag_of_Belize.svg"], ["Serbiya", "Belqrad", "https://upload.wikimedia.org/wikipedia/commons/f/ff/Flag_of_Serbia.svg"], ["Almaniya", "Berlin", "https://upload.wikimedia.org/wikipedia/commons/b/ba/Flag_of_Germany.svg"], ["İsveçrə", "Bern", "https://upload.wikimedia.org/wikipedia/commons/f/f3/Flag_of_Switzerland.svg"], ["Livan", "Beyrut", "https://upload.wikimedia.org/wikipedia/commons/5/59/Flag_of_Lebanon.svg"], ["Qvineya-Bisau", "Bisau", "https://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_Guinea-Bissau.svg"], ["Qırğızıstan", "Bişkek", "https://upload.wikimedia.org/wikipedia/commons/c/c7/Flag_of_Kyrgyzstan.svg"], ["Kolumbiya", "Boqota", "https://upload.wikimedia.org/wikipedia/commons/2/21/Flag_of_Colombia.svg"], ["Slovakiya", "Bratislava", "https://upload.wikimedia.org/wikipedia/commons/e/e6/Flag_of_Slovakia.svg"], ["Braziliya", "Braziliya", "https://upload.wikimedia.org/wikipedia/commons/0/05/Flag_of_Brazil.svg"], ["Konqo Respublikası", "Brazzavil", "https://upload.wikimedia.org/wikipedia/commons/9/92/Flag_of_the_Republic_of_the_Congo.svg"], ["Barbados", "Brictaun", "https://upload.wikimedia.org/wikipedia/commons/e/ef/Flag_of_Barbados.svg"], ["Belçika", "Brüssel", "https://upload.wikimedia.org/wikipedia/commons/9/92/Flag_of_Belgium_%28civil%29.svg"], ["Burundi", "Bujumbura", "https://upload.wikimedia.org/wikipedia/commons/5/50/Flag_of_Burundi.svg"], ["Macarıstan", "Budapeşt", "https://upload.wikimedia.org/wikipedia/commons/c/c1/Flag_of_Hungary.svg"], ["Argentina", "Buenos Ayres", "https://upload.wikimedia.org/wikipedia/commons/1/1a/Flag_of_Argentina.svg"], ["Rumıniya", "Buxarest", "https://upload.wikimedia.org/wikipedia/commons/7/73/Flag_of_Romania.svg"], ["İndoneziya", "Cakarta", "https://upload.wikimedia.org/wikipedia/commons/9/9f/Flag_of_Indonesia.svg"], ["Sent-Lüsiya", "Kastris", "https://upload.wikimedia.org/wikipedia/commons/9/9f/Flag_of_Saint_Lucia.svg"], ["Müqəddəs Yelena, Askenson və Tristan-da-Kunya adaları", "Ceymstaun", "https://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Saint_Helena.svg"], ["Cəbəli-Tariq", "Cəbəli-Tariq", "https://upload.wikimedia.org/wikipedia/commons/0/02/Flag_of_Gibraltar.svg"], ["Kiribati", "Cənubi Tarava", "https://upload.wikimedia.org/wikipedia/commons/d/d3/Flag_of_Kiribati.svg"], ["Cibuti", "Cibuti", "https://upload.wikimedia.org/wikipedia/commons/3/34/Flag_of_Djibouti.svg"], ["Kayman adaları", "Corctaun", "https://upload.wikimedia.org/wikipedia/commons/0/0f/Flag_of_the_Cayman_Islands.svg"], ["Qayana", "Corctaun", "https://upload.wikimedia.org/wikipedia/commons/9/99/Flag_of_Guyana.svg"], ["Banqladeş", "Dəkkə", "https://upload.wikimedia.org/wikipedia/commons/f/f9/Flag_of_Bangladesh.svg"], ["Seneqal", "Dakar", "https://upload.wikimedia.org/wikipedia/commons/f/fd/Flag_of_Senegal.svg"], ["Suriya", "Dəməşq", "https://upload.wikimedia.org/wikipedia/commons/5/53/Flag_of_Syria.svg"], ["Özbəkistan", "Daşkənd", "https://upload.wikimedia.org/wikipedia/commons/8/84/Flag_of_Uzbekistan.svg"], ["Şərqi Timor", "Dili", "https://upload.wikimedia.org/wikipedia/commons/2/26/Flag_of_East_Timor.svg"], ["Tanzaniya", "Dodoma (rəsmi), Dar əs Salam (inzibati)", "https://upload.wikimedia.org/wikipedia/commons/3/38/Flag_of_Tanzania.svg"], ["Qətər", "Doha", "https://upload.wikimedia.org/wikipedia/commons/6/65/Flag_of_Qatar.svg"], ["İrlandiya", "Dublin", "https://upload.wikimedia.org/wikipedia/commons/4/45/Flag_of_Ireland.svg"], ["Men adası", "Duqlas", "https://upload.wikimedia.org/wikipedia/commons/5/5d/Flag_of_the_Isle_of_Mann.svg"], ["Tacikistan", "Düşənbə", "https://upload.wikimedia.org/wikipedia/commons/d/d0/Flag_of_Tajikistan.svg"], ["Akrotiri və Dekeliya", "Episkopi", "https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_the_United_Kingdom_%283-5%29.svg"], ["BƏƏ", "Əbu-Dabi", "https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_the_United_Arab_Emirates.svg"], ["Efiopiya", "Əddis-Əbəbə", "https://upload.wikimedia.org/wikipedia/commons/7/71/Flag_of_Ethiopia.svg"], ["Əlcəzair", "Əlcəzair", "https://upload.wikimedia.org/wikipedia/commons/7/77/Flag_of_Algeria.svg"], ["Qərbi Sahara", "Əl Əyun", "https://upload.wikimedia.org/wikipedia/commons/2/26/Flag_of_the_Sahrawi_Arab_Democratic_Republic.svg"], ["Səudiyyə Ərəbistanı", "Ər-Riyad", "https://upload.wikimedia.org/wikipedia/commons/0/0d/Flag_of_Saudi_Arabia.svg"], ["İordaniya", "Əmman", "https://upload.wikimedia.org/wikipedia/commons/c/c0/Flag_of_Jordan.svg"], ["Eritreya", "Asmera", "https://upload.wikimedia.org/wikipedia/commons/2/29/Flag_of_Eritrea.svg"], ["Kamboca", "Pnompen", "https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_Cambodia.svg"], ["Syerra-Leone", "Fritaun", "https://upload.wikimedia.org/wikipedia/commons/1/17/Flag_of_Sierra_Leone.svg"], ["Tuvalu", "Funafuti", "https://upload.wikimedia.org/wikipedia/commons/3/38/Flag_of_Tuvalu.svg"], ["Bermud adaları", "Hamilton", "https://upload.wikimedia.org/wikipedia/commons/b/bf/Flag_of_Bermuda.svg"], ["Vyetnam", "Hanoy", "https://upload.wikimedia.org/wikipedia/commons/2/21/Flag_of_Vietnam.svg"], ["Quam", "Haqatna", "https://upload.wikimedia.org/wikipedia/commons/0/07/Flag_of_Guam.svg"], ["Zimbabve", "Harare", "https://upload.wikimedia.org/wikipedia/commons/6/6a/Flag_of_Zimbabwe.svg"], ["Somalilend", "Hargeisa", "https://upload.wikimedia.org/wikipedia/commons/4/4d/Flag_of_Somaliland.svg"], ["Kuba", "Havana", "https://upload.wikimedia.org/wikipedia/commons/b/bd/Flag_of_Cuba.svg"], ["Finlandiya", "Helsinki", "https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Finland.svg"], ["Solomon adaları", "Honiara", "https://upload.wikimedia.org/wikipedia/commons/7/74/Flag_of_the_Solomon_Islands.svg"], ["Honkonq", "Honkonq", "https://upload.wikimedia.org/wikipedia/commons/5/5b/Flag_of_Hong_Kong.svg"], ["Sudan", "Xartum", "https://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_Sudan.svg"], ["Pakistan", "İslamabad", "https://upload.wikimedia.org/wikipedia/commons/3/32/Flag_of_Pakistan.svg"], ["Əfqanıstan", "Kabul", "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_the_Taliban.svg"], ["Uqanda", "Kampala", "https://upload.wikimedia.org/wikipedia/commons/4/4e/Flag_of_Uganda.svg"], ["Avstraliya", "Kanberra", "https://upload.wikimedia.org/wikipedia/commons/b/b9/Flag_of_Australia.svg"], ["Venesuela", "Karakas", "https://upload.wikimedia.org/wikipedia/commons/7/7b/Flag_of_Venezuela_%28state%29.svg"], ["Nepal", "Katmandu", "https://upload.wikimedia.org/wikipedia/commons/9/9b/Flag_of_Nepal.svg"], ["Ukrayna", "Kiyev", "https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg"], ["Sent-Vinsent və Qrenadin", "Kinqstaun", "https://upload.wikimedia.org/wikipedia/commons/6/6d/Flag_of_Saint_Vincent_and_the_Grenadines.svg"], ["Norfolk adası", "Kinqston (rəsmi), Ban Pain (faktiki)", "https://upload.wikimedia.org/wikipedia/commons/4/48/Flag_of_Norfolk_Island.svg"], ["Yamayka", "Kinqston", "https://upload.wikimedia.org/wikipedia/commons/0/0a/Flag_of_Jamaica.svg"], ["KDR", "Kinşasa", "https://upload.wikimedia.org/wikipedia/commons/6/6f/Flag_of_the_Democratic_Republic_of_the_Congo.svg"], ["Ruanda", "Kiqali", "https://upload.wikimedia.org/wikipedia/commons/1/17/Flag_of_Rwanda.svg"], ["Moldova", "Kişinyov", "https://upload.wikimedia.org/wikipedia/commons/2/27/Flag_of_Moldova.svg"], ["Törks və Kaykos adaları", "Kobərn Taun", "https://upload.wikimedia.org/wikipedia/commons/a/a0/Flag_of_the_Turks_and_Caicos_Islands.svg"], ["Şri-Lanka", "Kolombo (qismən), Şri Cayavardenepura Kotte (rəsmi)", "https://upload.wikimedia.org/wikipedia/commons/1/11/Flag_of_Sri_Lanka.svg"], ["Qvineya", "Konakri", "https://upload.wikimedia.org/wikipedia/commons/e/ed/Flag_of_Guinea.svg"], ["Danimarka", "Kopenhagen", "https://upload.wikimedia.org/wikipedia/commons/9/9c/Flag_of_Denmark.svg"], ["Malayziya", "Kuala Lumpur (rəsmi), Putracaya (inzibati)", "https://upload.wikimedia.org/wikipedia/commons/6/66/Flag_of_Malaysia.svg"], ["Küveyt", "Küveyt", "https://upload.wikimedia.org/wikipedia/commons/a/aa/Flag_of_Kuwait.svg"], ["Ekvador", "Kito", "https://upload.wikimedia.org/wikipedia/commons/e/e8/Flag_of_Ecuador.svg"], ["Botsvana", "Qaborone", "https://upload.wikimedia.org/wikipedia/commons/f/fa/Flag_of_Botswana.svg"], ["Misir", "Qahirə", "https://upload.wikimedia.org/wikipedia/commons/f/fe/Flag_of_Egypt.svg"], ["Sen-Bartelemi", "Qustaviya", "https://upload.wikimedia.org/wikipedia/commons/b/b4/Flag_of_Saint_Barth%C3%A9lemy_%28local%29.svg"], ["İsrail", "Qüds", "https://upload.wikimedia.org/wikipedia/commons/d/d4/Flag_of_Israel.svg"], ["Qvatemala", "Qvatemala", "https://upload.wikimedia.org/wikipedia/commons/e/ec/Flag_of_Guatemala.svg"], ["Malta", "La Valletta", "https://upload.wikimedia.org/wikipedia/commons/7/73/Flag_of_Malta.svg"], ["Qabon", "Librevil", "https://upload.wikimedia.org/wikipedia/commons/0/04/Flag_of_Gabon.svg"], ["Malavi", "Lilonqve", "https://upload.wikimedia.org/wikipedia/commons/d/d1/Flag_of_Malawi.svg"], ["Peru", "Lima", "https://upload.wikimedia.org/wikipedia/commons/d/df/Flag_of_Peru_%28state%29.svg"], ["Portuqaliya", "Lissabon", "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_Portugal.svg"], ["Toqo", "Lome", "https://upload.wikimedia.org/wikipedia/commons/6/68/Flag_of_Togo.svg"], ["Böyük Britaniya", "London", "https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_the_United_Kingdom_%283-5%29.svg"], ["Şpisbergen və Yan-Mayen", "Lonqyirbyuen", "https://upload.wikimedia.org/wikipedia/commons/d/d9/Flag_of_Norway.svg"], ["Anqola", "Luanda", "https://upload.wikimedia.org/wikipedia/commons/9/9d/Flag_of_Angola.svg"], ["Zambiya", "Lusaka", "https://upload.wikimedia.org/wikipedia/commons/0/06/Flag_of_Zambia.svg"], ["Lüksemburq", "Lüksemburq", "https://upload.wikimedia.org/wikipedia/commons/d/da/Flag_of_Luxembourg.svg"], ["Sloveniya", "Lüblyana", "https://upload.wikimedia.org/wikipedia/commons/f/f0/Flag_of_Slovenia.svg"], ["Marşall adaları", "Macuro", "https://upload.wikimedia.org/wikipedia/commons/2/2e/Flag_of_the_Marshall_Islands.svg"], ["İspaniya", "Madrid", "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Spain.svg"], ["Makao", "Makao", "https://upload.wikimedia.org/wikipedia/commons/6/63/Flag_of_Macau.svg"], ["Ekvatorial Qvineya", "Malabo", "https://upload.wikimedia.org/wikipedia/commons/3/31/Flag_of_Equatorial_Guinea.svg"], ["Maldiv adaları", "Male", "https://upload.wikimedia.org/wikipedia/commons/0/0f/Flag_of_Maldives.svg"], ["Mayotta", "Mamudzu", "https://upload.wikimedia.org/wikipedia/commons/4/4a/Flag_of_Mayotte_%28local%29.svg"], ["Bəhreyn", "Manama", "https://upload.wikimedia.org/wikipedia/commons/2/2c/Flag_of_Bahrain.svg"], ["Nikaraqua", "Manaqua", "https://upload.wikimedia.org/wikipedia/commons/1/19/Flag_of_Nicaragua.svg"], ["Filippin", "Manila", "https://upload.wikimedia.org/wikipedia/commons/9/99/Flag_of_the_Philippines.svg"], ["Mozambik", "Maputo", "https://upload.wikimedia.org/wikipedia/commons/d/d0/Flag_of_Mozambique.svg"], ["Aland adaları", "Mariehamn", "https://upload.wikimedia.org/wikipedia/commons/5/52/Flag_of_%C3%85land.svg"], ["Sen-Marten", "Mariqo", "https://upload.wikimedia.org/wikipedia/commons/d/dd/Flag_of_Saint-Martin_%28fictional%29.svg"], ["Lesoto", "Maseru", "https://upload.wikimedia.org/wikipedia/commons/4/4a/Flag_of_Lesotho.svg"], ["Uollis və Futuna", "Mata-Utu", "https://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg"], ["Tonqa", "Nukualofa", "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Tonga.svg"], ["Esvatini", "Mbabane (rəsmi, inzibati), Lobamba (kral və qanunverici orqan)", "https://upload.wikimedia.org/wikipedia/commons/f/fb/Flag_of_Eswatini.svg"], ["Palau", "Nqerulmud", "https://upload.wikimedia.org/wikipedia/commons/4/48/Flag_of_Palau.svg"], ["Meksika", "Mexiko", "https://upload.wikimedia.org/wikipedia/commons/f/fc/Flag_of_Mexico.svg"], ["Belarus", "Minsk", "https://upload.wikimedia.org/wikipedia/commons/8/85/Flag_of_Belarus.svg"], ["Monako", "Monako", "https://upload.wikimedia.org/wikipedia/commons/e/ea/Flag_of_Monaco.svg"], ["Liberiya", "Monroviya", "https://upload.wikimedia.org/wikipedia/commons/b/b8/Flag_of_Liberia.svg"], ["Uruqvay", "Montevideo", "https://upload.wikimedia.org/wikipedia/commons/f/fe/Flag_of_Uruguay.svg"], ["Somali", "Moqadişo", "https://upload.wikimedia.org/wikipedia/commons/a/a0/Flag_of_Somalia.svg"], ["Komor adaları", "Moroni", "https://upload.wikimedia.org/wikipedia/commons/9/94/Flag_of_the_Comoros.svg"], ["Rusiya", "Moskva", "https://upload.wikimedia.org/wikipedia/commons/f/f3/Flag_of_Russia.svg"], ["Oman", "Maskat", "https://upload.wikimedia.org/wikipedia/commons/d/dd/Flag_of_Oman.svg"], ["Baham adaları", "Nassau", "https://upload.wikimedia.org/wikipedia/commons/9/93/Flag_of_the_Bahamas.svg"], ["Myanma", "Naypyida", "https://upload.wikimedia.org/wikipedia/commons/8/8c/Flag_of_Myanmar.svg"], ["Keniya", "Nayrobi", "https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Kenya.svg"], ["Çad", "Ncamena", "https://upload.wikimedia.org/wikipedia/commons/4/4b/Flag_of_Chad.svg"], ["Niger", "Niamey", "https://upload.wikimedia.org/wikipedia/commons/f/f4/Flag_of_Niger.svg"], ["Kipr", "Nikosiya", "https://upload.wikimedia.org/wikipedia/commons/d/d4/Flag_of_Cyprus.svg"], ["Mavritaniya", "Nuakşot", "https://upload.wikimedia.org/wikipedia/commons/4/43/Flag_of_Mauritania.svg"], ["Tokelau", "Nukunonu", "https://upload.wikimedia.org/wikipedia/commons/8/8e/Flag_of_Tokelau.svg"], ["Yeni Kaledoniya", "Numea", "https://upload.wikimedia.org/wikipedia/commons/6/66/Flag_of_FLNKS.svg"], ["Qrenlandiya", "Nuuk", "https://upload.wikimedia.org/wikipedia/commons/0/09/Flag_of_Greenland.svg"], ["Hindistan", "Dehli", "https://upload.wikimedia.org/wikipedia/commons/4/41/Flag_of_India.svg"], ["Aruba", "Oranjestad", "https://upload.wikimedia.org/wikipedia/commons/f/f6/Flag_of_Aruba.svg"], ["Norveç", "Oslo", "https://upload.wikimedia.org/wikipedia/commons/d/d9/Flag_of_Norway.svg"], ["Kanada", "Ottava", "https://upload.wikimedia.org/wikipedia/commons/d/d9/Flag_of_Canada_%28Pantone%29.svg"], ["Burkina-Faso", "Uaqaduqu", "https://upload.wikimedia.org/wikipedia/commons/3/31/Flag_of_Burkina_Faso.svg"], ["Mikroneziya", "Palikir", "https://upload.wikimedia.org/wikipedia/commons/e/e4/Flag_of_the_Federated_States_of_Micronesia.svg"], ["Panama", "Panama", "https://upload.wikimedia.org/wikipedia/commons/a/ab/Flag_of_Panama.svg"], ["Amerika Samoası", "Paqo Paqo", "https://upload.wikimedia.org/wikipedia/commons/8/87/Flag_of_American_Samoa.svg"], ["Surinam", "Paramaribo", "https://upload.wikimedia.org/wikipedia/commons/6/60/Flag_of_Suriname.svg"], ["Fransa", "Paris", "https://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg"], ["ÇXR", "Pekin", "https://upload.wikimedia.org/wikipedia/commons/f/fa/Flag_of_the_People%27s_Republic_of_China.svg"], ["Montserrat", "Plimut (de yure), Breyds (de fakto)", "https://upload.wikimedia.org/wikipedia/commons/d/d0/Flag_of_Montserrat.svg"], ["Monteneqro", "Podqoritsa", "https://upload.wikimedia.org/wikipedia/commons/6/64/Flag_of_Montenegro.svg"], ["Mavriki", "Port Luiz", "https://upload.wikimedia.org/wikipedia/commons/7/77/Flag_of_Mauritius.svg"], ["Papua-Yeni Qvineya", "Port Morsbi", "https://upload.wikimedia.org/wikipedia/commons/e/e3/Flag_of_Papua_New_Guinea.svg"], ["Trinidad və Tobaqo", "Port of Speyn", "https://upload.wikimedia.org/wikipedia/commons/6/64/Flag_of_Trinidad_and_Tobago.svg"], ["Vanuatu", "Port Vila", "https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Vanuatu.svg"], ["Haiti", "Port-o-Prins", "https://upload.wikimedia.org/wikipedia/commons/5/56/Flag_of_Haiti.svg"], ["Benin", "Porto-Novo", "https://upload.wikimedia.org/wikipedia/commons/0/0a/Flag_of_Benin.svg"], ["Çexiya", "Praqa", "https://upload.wikimedia.org/wikipedia/commons/c/cb/Flag_of_the_Czech_Republic.svg"], ["Kabo-Verde", "Praya", "https://upload.wikimedia.org/wikipedia/commons/3/38/Flag_of_Cape_Verde.svg"], ["CAR", "Pretoriya (rəsmi və inzibati), Keyptaun (qanunverici), Blumfonteyn (məhkəmə)", "https://upload.wikimedia.org/wikipedia/commons/a/af/Flag_of_South_Africa.svg"], ["KXDR", "Pxenyan", "https://upload.wikimedia.org/wikipedia/commons/5/51/Flag_of_North_Korea.svg"], ["Mərakeş", "Rabat", "https://upload.wikimedia.org/wikipedia/commons/2/2c/Flag_of_Morocco.svg"], ["Fələstin Dövləti", "Ramallah", "https://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Palestine.svg"], ["İslandiya", "Reykyavik", "https://upload.wikimedia.org/wikipedia/commons/c/ce/Flag_of_Iceland.svg"], ["Latviya", "Riqa", "https://upload.wikimedia.org/wikipedia/commons/8/84/Flag_of_Latvia.svg"], ["İtaliya", "Roma", "https://upload.wikimedia.org/wikipedia/commons/0/03/Flag_of_Italy.svg"], ["Dominika", "Rozo", "https://upload.wikimedia.org/wikipedia/commons/c/c4/Flag_of_Dominica.svg"], ["Britaniya Vircin adaları", "Roud Taun", "https://upload.wikimedia.org/wikipedia/commons/4/42/Flag_of_the_British_Virgin_Islands.svg"], ["Fransa Polineziyası", "Papeete", "https://upload.wikimedia.org/wikipedia/commons/d/db/Flag_of_French_Polynesia.svg"], ["San-Marino", "San Marino (şəhər)", "https://upload.wikimedia.org/wikipedia/commons/b/b1/Flag_of_San_Marino.svg"], ["Salvador", "San Salvador", "https://upload.wikimedia.org/wikipedia/commons/3/34/Flag_of_El_Salvador.svg"], ["San-Tome və Prinsipi", "San Tome", "https://upload.wikimedia.org/wikipedia/commons/0/0a/Flag_of_S%C3%A3o_Tom%C3%A9_and_Pr%C3%ADncipe.svg"], ["Kosta-Rika", "San-Xose", "https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Costa_Rica_%28state%29.svg"], ["Puerto-Riko", "San Xuan", "https://upload.wikimedia.org/wikipedia/commons/2/28/Flag_of_Puerto_Rico.svg"], ["Yəmən", "Səna", "https://upload.wikimedia.org/wikipedia/commons/8/89/Flag_of_Yemen.svg"], ["Dominikan Respublikası", "Santo Dominqo", "https://upload.wikimedia.org/wikipedia/commons/9/9f/Flag_of_the_Dominican_Republic.svg"], ["Çili", "Santyaqo (rəsmi), Valparaiso (qanunverici)", "https://upload.wikimedia.org/wikipedia/commons/7/78/Flag_of_Chile.svg"], ["Bosniya və Herseqovina", "Sarayevo", "https://upload.wikimedia.org/wikipedia/commons/b/bf/Flag_of_Bosnia_and_Herzegovina.svg"], ["Şimali Marian adaları", "Saypan", "https://upload.wikimedia.org/wikipedia/commons/e/e0/Flag_of_the_Northern_Mariana_Islands.svg"], ["Antiqua və Barbuda", "Sent Cons", "https://upload.wikimedia.org/wikipedia/commons/8/89/Flag_of_Antigua_and_Barbuda.svg"], ["Qrenada", "Sent Corces", "https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Grenada.svg"], ["Cersi", "Sent Helier", "https://upload.wikimedia.org/wikipedia/commons/1/1c/Flag_of_Jersey.svg"], ["Gernsi", "Sent Piter Port", "https://upload.wikimedia.org/wikipedia/commons/f/fa/Flag_of_Guernsey.svg"], ["Sen-Pyer və Mikelon", "Sent Pyer", "https://upload.wikimedia.org/wikipedia/commons/7/74/Flag_of_Saint-Pierre_and_Miquelon.svg"], ["Cənubi Koreya", "Seul", "https://upload.wikimedia.org/wikipedia/commons/0/09/Flag_of_South_Korea.svg"], ["Sinqapur", "Sinqapur", "https://upload.wikimedia.org/wikipedia/commons/4/48/Flag_of_Singapore.svg"], ["Şimali Makedoniya", "Skopye", "https://upload.wikimedia.org/wikipedia/commons/7/79/Flag_of_North_Macedonia.svg"], ["Bolqarıstan", "Sofiya", "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Bulgaria.svg"], ["Folklend adaları", "Stenli", "https://upload.wikimedia.org/wikipedia/commons/8/83/Flag_of_the_Falkland_Islands.svg"], ["İsveç", "Stokholm", "https://upload.wikimedia.org/wikipedia/commons/4/4c/Flag_of_Sweden.svg"], ["Boliviya", "Sukre (şəhər) (konstitusional, məhkəmə), La Pas (inzibati)", "https://upload.wikimedia.org/wikipedia/commons/4/48/Flag_of_Bolivia.svg"], ["Fici", "Suva", "https://upload.wikimedia.org/wikipedia/commons/b/ba/Flag_of_Fiji.svg"], ["Amerika Virgin adaları", "Şarlotta-Amaliya", "https://upload.wikimedia.org/wikipedia/commons/f/f8/Flag_of_the_United_States_Virgin_Islands.svg"], ["Estoniya", "Tallin", "https://upload.wikimedia.org/wikipedia/commons/8/8f/Flag_of_Estonia.svg"], ["Çin Respublikası", "Taybey", "https://upload.wikimedia.org/wikipedia/commons/7/72/Flag_of_the_Republic_of_China.svg"], ["İran", "Tehran", "https://upload.wikimedia.org/wikipedia/commons/c/ca/Flag_of_Iran.svg"], ["Honduras", "Tequsiqalpa", "https://upload.wikimedia.org/wikipedia/commons/8/82/Flag_of_Honduras.svg"], ["Milad adası", "Flayinq Fiş Kouv", "https://upload.wikimedia.org/wikipedia/commons/6/67/Flag_of_Christmas_Island.svg"], ["Gürcüstan", "Tbilisi", "https://upload.wikimedia.org/wikipedia/commons/0/0f/Flag_of_Georgia.svg"], ["Albaniya", "Tirana", "https://upload.wikimedia.org/wikipedia/commons/3/36/Flag_of_Albania.svg"], ["Yaponiya", "Tokio", "https://upload.wikimedia.org/wikipedia/commons/9/9e/Flag_of_Japan.svg"], ["Farer adaları", "Torshavn", "https://upload.wikimedia.org/wikipedia/commons/3/3c/Flag_of_the_Faroe_Islands.svg"], ["Liviya", "Tripoli", "https://upload.wikimedia.org/wikipedia/commons/0/05/Flag_of_Libya.svg"], ["Tunis", "Tunis", "https://upload.wikimedia.org/wikipedia/commons/c/ce/Flag_of_Tunisia.svg"], ["Monqolustan", "Ulan-Bator", "https://upload.wikimedia.org/wikipedia/commons/4/4c/Flag_of_Mongolia.svg"], ["Lixtenşteyn", "Vaduts", "https://upload.wikimedia.org/wikipedia/commons/4/47/Flag_of_Liechtenstein.svg"], ["Angilya", "Valley", "https://upload.wikimedia.org/wikipedia/commons/b/b4/Flag_of_Anguilla.svg"], ["Polşa", "Varşava", "https://upload.wikimedia.org/wikipedia/commons/1/12/Flag_of_Poland.svg"], ["ABŞ", "Vaşinqton", "https://upload.wikimedia.org/wikipedia/commons/a/a4/Flag_of_the_United_States.svg"], ["Vatikan", "Vatikan", "https://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_the_Vatican_City.svg"], ["Yeni Zelandiya", "Vellinqton", "https://upload.wikimedia.org/wikipedia/commons/3/3e/Flag_of_New_Zealand.svg"], ["Avstriya", "Vyana", "https://upload.wikimedia.org/wikipedia/commons/4/41/Flag_of_Austria.svg"], ["Laos", "Vyentyan", "https://upload.wikimedia.org/wikipedia/commons/5/56/Flag_of_Laos.svg"], ["Seyşel adaları", "Viktoriya", "https://upload.wikimedia.org/wikipedia/commons/f/fc/Flag_of_Seychelles.svg"], ["Niderland Antil adaları", "Villemştad", "https://upload.wikimedia.org/wikipedia/commons/a/ae/Flag_of_the_Netherlands_Antilles_%281986%E2%80%932010%29.svg"], ["Litva", "Vilnüs", "https://upload.wikimedia.org/wikipedia/commons/1/11/Flag_of_Lithuania.svg"], ["Namibiya", "Vindhuk", "https://upload.wikimedia.org/wikipedia/commons/0/00/Flag_of_Namibia.svg"], ["Kokos adaları", "Vest Aylend", "https://upload.wikimedia.org/wikipedia/commons/7/74/Flag_of_the_Cocos_%28Keeling%29_Islands.svg"], ["Kot-d'İvuar", "Yamusukro", "https://upload.wikimedia.org/wikipedia/commons/f/fe/Flag_of_C%C3%B4te_d%27Ivoire.svg"], ["Kamerun", "Yaunde", "https://upload.wikimedia.org/wikipedia/commons/4/4f/Flag_of_Cameroon.svg"], ["Nauru", "Yaren", "https://upload.wikimedia.org/wikipedia/commons/3/30/Flag_of_Nauru.svg"], ["Xorvatiya", "Zaqreb", "https://upload.wikimedia.org/wikipedia/commons/1/1b/Flag_of_Croatia.svg"], ["Butan", "Thimphu", "https://upload.wikimedia.org/wikipedia/commons/9/91/Flag_of_Bhutan.svg"], ["Cənubi Sudan", "Cuba", "https://upload.wikimedia.org/wikipedia/commons/7/7a/Flag_of_South_Sudan.svg"], ]
@app.route("/")
@cross_origin()
def index():
# @todo add rapid api token condition
q = request.args.get('q', '')
if q == '':
return 'Zəhmət olmasa, axtarış sözünü göndərin!', 400
output = list(
filter(lambda r: q.lower() in (r[0] + r[1]).lower(), db)
)
return jsonify(output)