Cydo
Cydo
Explore posts from servers
CC#
Created by Cydo on 1/7/2025 in #help
✅ Can't get HTTPS to work for my api deployment.
Working HTTP
server {
listen 80;
server_name questbound.xyz www.questbound.xyz;

# SSL Configuration
ssl_certificate /etc/letsencrypt/live/questbound.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/questbound.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

# Proxy to your backend API
location / {
proxy_pass http://0.0.0.0:5000; # Ensure the API is running here
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name questbound.xyz www.questbound.xyz;

# SSL Configuration
ssl_certificate /etc/letsencrypt/live/questbound.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/questbound.xyz/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

# Proxy to your backend API
location / {
proxy_pass http://0.0.0.0:5000; # Ensure the API is running here
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
2 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Did not know that, thought it was all just the same stuff with out controllers tbh.
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Yeah, sometimes it just feels like I'm doing way more in MVC to get a simple api going then I should really need to, so I figured switching to using minimal api would let me bring my ideas to life much quicker, i've read minimal api is a lot closer to express which is/was the backend i am most use to using, except I have moved away from even touching Js/Ts for anything outside the frontend lol
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Gotcha my next plan after what im currently working on is to learn minimal api, is that a good idea or should I just focus on improving with MVC and such, aiming for a job in the .NET ecosystem lol
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Gotcha, I thought i saw somewhere that when u use minimal api, you make like action specific files so like POST would just be a file containting a post method for a specific route etc.
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Haha fair, I come from mainly frontend development and my previous job was wordpress so using C#/.NET compared to react and just vanilla php is a different beast
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Is that what you do for minimal api's?
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
The one method per controller seems insane to me, but having only been learning .NET for 144 days I'll leave that to my inexperience lol. So overall, its probably better to use a result pattern and handle those errors then to use exceptions since its harder for outside users of an API to understand why/when an exception will be thrown? But I also thought you can decorate ur endpoints in ur controller with [ProducesResponseType(typeof(ErrorResponse), StatusCodes.Status404NotFound)] and that will document ur API's possible responses in Swagger? Or do you mean that even if it's documented like that, it doesnt actually tell you why/what will cause those exceptions to be thrown regardless?
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
I wanna add testing, just havent learned it yet, its on the list tho lol
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
wdym a single action per controller?
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
@shua Turns out the repo was public this entire time lol, Im still trying to refactor everything back to using exceptions instead of my shotty Result pattern so its a bit of a messge in there, but i refactored at least the auth, and party service if u wanted to take a look and potentionally vomit https://github.com/CydoEntis/collabparty-backend
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Yeah when I was writing the one implementation, it always seemed like I had to go back and add one more thing that I didnt think of at the time and it was getting more complex and overwhelming each iteration. I'm currently going back and just switching to throw exceptions now, my goal has changed from making this thing perfect using all these "design patterns" to just functioning deployed app.
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
not at my computer but tomorrow, i can make it public and post the link here, it could prob use some hard code review, so i can see where to make improvements tbh
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
its private, but it could def be public, the apps gonna go on my portfolio if i ever finish it and figure out how to deploy a .net app lol
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
Yeah, u right, just wanna work on something else but i refuse till i really understand wtf im doing
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
been learning C# and .NET for like 140 days now and ive almost made myself rage quit this ecosystem 😂
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
this app has been literally complete for 2 months and i keep going back trying to make it perfect and its killing me xD
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
thats what i was doing in the first ever iteration of this app, but then like Fluent Validation, was sending errors exactly how i wanted and im like i want that lol
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
what about for the errors that arent neccessarily needed in a dictionary?
160 replies
CC#
Created by Cydo on 12/29/2024 in #help
Trying to understand proper error handling
I saw this when i was asking Chatgpt for help lol
160 replies