This tutorial's goal is to demonstrate how to protect your API keys from malicious users.
In this article/tutorial we are going to create an API Proxy Server using NodeJS and the main reason behind this is to show you how to hide public API keys and not expose them in the public like I was doing in past. All of us have created an application once, just to get to know a new library or a framework, and the best way to achieve this is to use an open API (like TMDB).
- NodeJs installed on your machine
- Coffee
- Clone repository
- Install dependencies
git clone https://github.com/ThPadelis/api-proxy-server.git
cd api-proxy-server
npm install
The application is separated to two sides. The Front-end (client/
) and the Back-end (server/
)
- Rename
.env.example
to.env
- Run the application with
npm run start -w client
command
- Rename
.env.example
to.env
- Get
API_KEY
from the OpenWeatherMap API and add it to the.env
file - Start the server with
npm run start -w server
command
This project is licensed under the MIT License - see the LICENSE.md file for details