Free Poland Address & Postal Code API in NodeJS&MySQL
A simple REST API built with Node.js, Express, and MySQL to fetch address data based on postal codes.
- Fetch all addresses
- Fetch an address by postal code
- Uses MySQL as the database
- Environment variables for secure configuration
git clone https://github.com/barisyeman/PolandPostalCodesAPI
cd address-api
npm installCreate a .env file in the root directory and set your database credentials:
DB_HOST=localhost
DB_USER=root
DB_PASS=your_password
DB_NAME=your_database
PORT=3000
node server.jsOr use nodemon for automatic restarts:
npx nodemon server.js- Get all addresses:
GET /api/all - Get address by postal code:
Example:
GET /api/{postal_code}GET /api/01-001
This project is licensed under the MIT License.
Proste REST API zbudowane w Node.js, Express i MySQL do pobierania danych adresowych na podstawie kodów pocztowych.
- Pobieranie wszystkich adresów
- Pobieranie adresu na podstawie kodu pocztowego
- MySQL jako baza danych
- Użycie zmiennych środowiskowych dla bezpiecznej konfiguracji
git clone https://github.com/barisyeman/PolandPostalCodesAPI
cd address-api
npm installUtwórz plik .env w katalogu głównym i ustaw dane dostępowe do bazy danych:
DB_HOST=localhost
DB_USER=root
DB_PASS=twoje_haslo
DB_NAME=twoja_baza
PORT=3000
node server.jsLub użyj nodemon do automatycznych restartów:
npx nodemon server.js- Pobierz wszystkie adresy:
GET /api/all - Pobierz adres na podstawie kodu pocztowego:
Przykład:
GET /api/{postal_code}GET /api/34000
Ten projekt jest licencjonowany na podstawie licencji MIT.