Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuri2peter/netlify-proxy
API proxy on Netlify Edge
https://github.com/yuri2peter/netlify-proxy
Last synced: 6 days ago
JSON representation
API proxy on Netlify Edge
- Host: GitHub
- URL: https://github.com/yuri2peter/netlify-proxy
- Owner: yuri2peter
- Created: 2024-01-23T00:43:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-23T02:41:33.000Z (about 1 year ago)
- Last Synced: 2024-11-17T00:33:47.960Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# netlify-proxy
API proxy on Netlify Edge
## Deploy
### Deploy With Netlify
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/yuri2peter/netlify-proxy)
## Usage
Use `_target` to specify the target URL.
Other parameters are passed to the target URL.```
curl https://{YOUR_DOMAIN}?_target=https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent&key={YOUR_KEY} \
-H 'Content-Type: application/json' \
-X POST \
-d '{ "contents":[
{ "parts":[{"text": "Hi"}]}
]
}'
```## Advantages
- Simple and free.
## Shortages
- Netlify sets the single request timeout to 10 seconds, which is kind of short.
## Discussion
Please Visit Simon's Blog. https://simonmy.com/posts/使用netlify反向代理google-palm-api.html