Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: Support CORS #290

Merged
merged 1 commit into from
Jan 23, 2023
Merged

api: Support CORS #290

merged 1 commit into from
Jan 23, 2023

Conversation

mitjat
Copy link
Collaborator

@mitjat mitjat commented Jan 23, 2023

Resolves #249

@lukaw3d if you're willing to test the frontend against this branch, the following should bring up a functional API server (backed by an empty DB):

make postgres
make oasis-indexer && ./oasis-indexer --config=config/local-dev.yml serve

Sample output:

$ curl -i -H 'Origin: example.com' 'localhost:8008/v1/consensus/blocks?limit=1'
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json
Vary: Origin
Date: Mon, 23 Jan 2023 12:48:57 GMT
Content-Length: 162

...

api/middleware.go Show resolved Hide resolved
Copy link
Member

@lukaw3d lukaw3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works!

@mitjat mitjat merged commit 1016ed8 into main Jan 23, 2023
@mitjat mitjat deleted the mitjat/cors branch January 23, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deploy with CORS enabled
3 participants