Skip to content

TovaApis/tovaapis-example-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tova APIs Cities - Node.js Proxy Server

A lightweight Express server that proxies requests to the Tova Cities API, keeping your API key safely on the server side.

What It Does

This proxy forwards requests from your frontend to the Tova Cities API, injecting your API key via the X-API-Key header so it never gets exposed to the browser. CORS is enabled for easy local development.

Available Routes

Route Description
GET / Health check (returns { status: "ok" })
GET /api/cities/search?q=...&iso3=... Search cities by name within a country (iso3 required; also supports n, contains)
GET /api/cities/:ucc Get a city by its UCC
GET /api/countries/:iso3 Get country info by ISO3 code
GET /api/nearest?lat=...&lon=... Find nearest cities (supports n, imp params)

Setup

  1. Install dependencies:
npm install
  1. Create your .env file from the example:
cp .env.example .env
  1. Open .env and replace your_api_key_here with your actual Tova API key.

  2. Start the server:

npm start

The server will start on http://localhost:3000 (or the port specified in your PORT env var).

Get an API Key

Sign up for a free API key at tovaapis.com.

API Documentation

Full endpoint docs are available at tovaapis.com/Docs/Cities.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors