proxy-server

command
v0.0.0-...-85872b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 6 Imported by: 0

README

Go Proxy

Discord

The Scalar Proxy redirects requests to another server to avoid CORS issues. It’s made to work well with the Scalar API Client.

Usage

Requirements
Run
go run main.go
2024/05/08 10:49:59 🥤 Proxy Server listening on http://localhost:1337
PORT=8080 go run main.go
Example
curl --request GET \
     --url 'localhost:1337?scalar_url=https%3A%2F%2Fgalaxy.scalar.com%2Fplanets'
{
  "data": [
    {
      "id": 1,
      "name": "Mars",
      "description": "The red planet",
      "image": "https://cdn.scalar.com/photos/mars.jpg",
      "creator": {
        "id": 1,
        "name": "Marc",
        "email": "[email protected]"
      }
    }
  ],
  "meta": {
    "limit": 10,
    "offset": 0,
    "total": 100,
    "next": "/planets?limit=10&offset=10"
  }
}

Yo, there’s no mod file.

You’re so right! We’re using the standard libraries. Isn’t that why we all love Go? Anyway, we just don’t need a mod file. :)

License

The source code in this repository is licensed under MIT.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL