https://github.com/harshitrv/proxy-server
API Proxy Server with Rate Limiting & Caching
https://github.com/harshitrv/proxy-server
express
Last synced: 14 days ago
JSON representation
API Proxy Server with Rate Limiting & Caching
- Host: GitHub
- URL: https://github.com/harshitrv/proxy-server
- Owner: HarshitRV
- Created: 2023-01-07T16:46:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T16:47:00.000Z (over 2 years ago)
- Last Synced: 2025-02-17T14:44:45.454Z (3 months ago)
- Topics: express
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Proxy Server with Rate Limiting & Caching
### This is a API proxy server that can be used to proxy requests to an API, and add rate limiting and caching to the response.
## Setup
1. Clone the repo
2. Run `npm install`
3. Create a env folder in the root directory
4. Create a `dev.env` file in the env folder
5. Get an API key from [Open Weather](https://openweathermap.org/api)
6. Add the following to the dev.env file
```
PORT=3000
WEATHER_API_KEY=YOUR_OPEN_WEATHER_API KEY
```
7. Run `npm run dev` to start the server
## Endpoints
### GET /weather?city={city name}optional query parameters:
- `city` - The name of the city to get the weather forexample: `GET /weather?city=London`
This endpoint will return the weather for the given city. The city can be passed in as a query parameter the response will be cached for 5 minutes and one can only send 100 requests under 10minutes.