ray1sx
TTCTheo's Typesafe Cult
•Created by ray1sx on 8/12/2023 in #questions
TypeScript complaining even the code is correct?
So even I am initializing the object TypeScript keeps yelling
acc[key]
might be undefined. What am I missing?6 replies
TTCTheo's Typesafe Cult
•Created by ray1sx on 7/11/2023 in #questions
POST API endpoint only working if request made from POSTMAN
I am developing an app which needs to send information to an endpoint another client has put online to receive POST requests. This is just a simple POST request I send with a body, then the client saves its body to wherever he wants to. This endpoint has no Authorization header as it has been removed recently due to thinking it might be the cause for it not to work. So, now, it only works if you do the request from Postman.
I created a simple Expressjs server and deployed on Vercel to mock that client endpoint for testing purposes (just returns the req.body to the client)
I deployed my main project on Vercel and made POST requests to my mock Express app. Works.
I deployed my main project on AWS Amplify and made POST requests to my mock Express app. Works.
But when I try to attack the original endpoint URL the client has put online, it just does not work. It returns a 404 status everytime. But not from Postman (200 status). I just don't get it... maybe I am malforming the requests? I just want to be really sure the issues is not on my end.
My code is part of a
create-t3-app
stack that uses tRPC
first to fetch information from my PlanetScale DB and then makes a POST request to that endpoint:35 replies
TTCTheo's Typesafe Cult
•Created by ray1sx on 7/6/2023 in #questions
Experiencing hell while dealing with tRPC procedures and the "input needs to be an object"... help
This is just a project that uses FB IG Graph API to retrieve information about the user and sends that to an endpoint. I googled and tried different approaches and I still can't see what is wrong.
I have also checked that returning typeof(input) results in "object" so I cannot understand why tRPC is not validating it as an object.
Also, I don't know why, but if I change the url to another url I get no trouble at all. This just has been driving me crazy the past few days trying to figure it out... Any help extremely appreciated!
14 replies