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

Creates api proxy #10

Merged
merged 2 commits into from
Jan 12, 2021
Merged

Creates api proxy #10

merged 2 commits into from
Jan 12, 2021

Conversation

kristofferlarberg
Copy link
Contributor

Resolves issue #7 .

Copy link
Member

@richardolsson richardolsson left a comment

Choose a reason for hiding this comment

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

Looking good! Nice work on this today!

I've added two comments, but you do not need to fix them now. I'll create separate issues for them.

return [
{
source: '/api/:slug*',
destination: 'https://api.zetk.in/v1/:slug*',
Copy link
Member

Choose a reason for hiding this comment

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

The URL to the Zetkin API should be externalized eventually, so that we can toggle between using the development environment and the live environment.

@@ -5,13 +5,13 @@ import { QueryClient, useQuery } from 'react-query';
function getEvents(orgId) {
return async () => {
try {
const cRes = await fetch(`http://api.zetk.in/v1/orgs/${orgId}/campaigns`);
const cRes = await fetch(`http://localhost:3000/api/orgs/${orgId}/campaigns`);
Copy link
Member

Choose a reason for hiding this comment

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

The domain (as well as scheme/protocol and port) of the app should be externalized eventually, so that it can be run with other settings in production.

@richardolsson richardolsson merged commit 5b58d24 into main Jan 12, 2021
@richardolsson richardolsson deleted the api-proxy branch January 12, 2021 13:27
This was referenced Jan 12, 2021
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.

2 participants