This is a Node.js and Express.js application that converts HTML5 geolocation coordinates into a human-readable address using India's geocoding services. The program exposes two APIs: /
for the homepage and /fetch
for backend communication. Using Reverse-Geocoding Method.
- Node.js (version 19.9.X or higher)
- npm (version 9.6.X or higher)
- MapMyIndia API KEY
- Clone the repository or download the source code.
- Navigate to the project directory.
- Run
npm install
to install the required dependencies.
- Run
node index.js
to start the application. - Open a web browser and go to
http://localhost:8081
to access the homepage. - Grant permission to access your location when prompted.
- The application will retrieve your coordinates and send them to India's geocoding service for address conversion.
- The converted address will be displayed on the webpage or sent as a structured response.
- To communicate with the backend, use the
/fetch
API endpoint.
- Returns the homepage where users can grant permission to access their location.
- Communicates with the backend to convert coordinates to an address.
- Request Body:
latitude
: The latitude coordinate.longitude
: The longitude coordinate.
- Response:
address
: The converted address in json.
Contributions are welcome! If you find any bugs or have suggestions for improvement, please open an issue or submit a pull request.
This project is licensed under the MIT License.