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

Direct api calls #491

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Direct api calls #491

merged 2 commits into from
Dec 19, 2024

Conversation

mmihalik
Copy link
Collaborator

No description provided.

path('accounts/', include('allauth.urls')),
path('django-admin/', admin.site.urls),
Copy link
Contributor

Choose a reason for hiding this comment

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

rozmyslam.. predpokladam, ze toto mame tiez v nginx ako routu. tak ci next rewrity/middleware nedrzat naozaj in sync s nginxom - napr. lokalne tym padom mozeme spravit localhost:3000/django-admin a smerovat to bude na BE (podla toho, ktory aktualne pouzivame). v podstate aby FE podporoval vsetky routy, ktore podporuje deployed stranka, aj lokalne.

posli tym padom prosim niekam vycet vsetkeho, co v nginx mame definovane

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Aktuálne ten nginx config vyzerá takto

server {
    location /static/ {
        proxy_pass http://localhost:8921/;
    }

    location /media/ {
        alias /data/www/webstrom-test/media/;
    }

    location /django-admin/ {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto https;

        proxy_pass http://localhost:8920/django-admin/;
    }

    location /api/ {
    	proxy_set_header X-Forwarded-Host $host;
	proxy_set_header X-Forwarded-Proto https;

	proxy_pass http://localhost:8920/api/;
    }

    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto https;

        proxy_pass http://localhost:8922/;
    }
}

Neviem či musím nutne držať tie rewrity 1:1 s nginxom, asi mi skôr príde lepšie ich obmedziť len na to čo je nutné aby ten frontend sa dal vyvíjať a zvyšok si proste vždy vieme otvoriť na backende. Ale nemám na to nejaký silný názor.

@mmihalik mmihalik merged commit 5fa0fa5 into master Dec 19, 2024
2 checks passed
@mmihalik mmihalik deleted the direct-api-calls branch December 19, 2024 21:45
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