teos
TTCTheo's Typesafe Cult
•Created by Mehul Sharma on 1/30/2024 in #questions
Dynamically set page title in app router (RSC)
It's exactly the same as
metadata
, just as an async function that must return an object, as you would expect6 replies
TTCTheo's Typesafe Cult
•Created by Mehul Sharma on 1/30/2024 in #questions
Dynamically set page title in app router (RSC)
https://nextjs.org/docs/app/api-reference/functions/generate-metadata
You can use
generateMetadata({ params })
6 replies
TTCTheo's Typesafe Cult
•Created by char on 11/10/2023 in #questions
computed properties in zod
Yes you can use
z.record(keyType, valueType)
(https://zod.dev/?id=record-key-type)
z.record(z.string().min(1), z.number())
3 replies
TTCTheo's Typesafe Cult
•Created by Eddy on 11/2/2023 in #questions
tRPC alternatives for a simple public API
@Eddy - SolarX is this the kind of project you're looking for ?
11 replies
TTCTheo's Typesafe Cult
•Created by Eddy on 11/2/2023 in #questions
tRPC alternatives for a simple public API
Technically, it could become tRPC compatible, but I'm not focusing on that right now. I just want to build fast AND have a RESTful API to share with other devs/teams (not a custom protocol like tRPC)
Let me now what you think, any feedback/help would be greatly appreciated 🤓
11 replies
TTCTheo's Typesafe Cult
•Created by Eddy on 11/2/2023 in #questions
tRPC alternatives for a simple public API
@Endgame1013 It's still a proof of concept, you're welcome to try it out. It won't replace tRPC anytime soon, but it lets you to define REST routes, and you can control searchParams, body, headers, etc, with full type safety
11 replies
TTCTheo's Typesafe Cult
•Created by Eddy on 11/2/2023 in #questions
tRPC alternatives for a simple public API
11 replies
TTCTheo's Typesafe Cult
•Created by Eddy on 11/2/2023 in #questions
tRPC alternatives for a simple public API
Sure, I need to publish it first, I'll post a link to npm here, probably tomorrow
11 replies
TTCTheo's Typesafe Cult
•Created by Eddy on 11/2/2023 in #questions
tRPC alternatives for a simple public API
I'm currently working on a small lib to build REST APIs in a similar way to tRPC. Which is a common use case I think, especially if you use tRPC already. I haven't released it yet, maybe you would be interested in trying it out ?
11 replies
TTCTheo's Typesafe Cult
•Created by Aiken Lapin Rowe on 10/17/2023 in #questions
Exclude dynamic routes in Clerk middleware
Clerk does not use the Next route format (they use regex instead)
6 replies
TTCTheo's Typesafe Cult
•Created by Aiken Lapin Rowe on 10/17/2023 in #questions
Exclude dynamic routes in Clerk middleware
You should try
ignoredRoutes: ['/test/(.*)']
instead6 replies
TTCTheo's Typesafe Cult
•Created by Ducky Sensei on 10/8/2023 in #questions
tRPC with stripe
You can initiate a Stripe payment from a tRPC procedure, or call a Stripe API, and you can do that from any part of your backend code.
The webhook on the other hand, is a specific format over a REST API. You won't be able to listen to Stripe events/callbacks with a simple tRPC procedure. It's just not meant for that. Even with middleware, etc, I would not recomend to try to setup a tRPC procedure for that...
5 replies
TTCTheo's Typesafe Cult
•Created by werz0xff on 9/20/2023 in #questions
Vercel responding with 405 for a api route
Maybe you could add a very quick explanation of what was happening, and mark the question as resolved, so that it can help others in your case
23 replies
TTCTheo's Typesafe Cult
•Created by werz0xff on 9/20/2023 in #questions
Vercel responding with 405 for a api route
Can't reproduce it on my end. Make sure you delete your
.next
folder et restart the server... just in case23 replies
TTCTheo's Typesafe Cult
•Created by werz0xff on 9/20/2023 in #questions
Vercel responding with 405 for a api route
If using App Router, you're using a method (GET, POST, etc) that you did not declare or export in your
route.ts
23 replies
TTCTheo's Typesafe Cult
•Created by BootesVoid on 9/11/2023 in #questions
Clerk middleware public routes
Without the code, it'll be difficult to help you
16 replies
TTCTheo's Typesafe Cult
•Created by werz0xff on 9/11/2023 in #questions
Nextjs middleware being ignored
Yeah, your example works fine on my end. Maybe try adding some logs to make sure the url is what you expect, and that
redirect()
is actually called. I don't see anything wrong with the code...6 replies
TTCTheo's Typesafe Cult
•Created by werz0xff on 9/11/2023 in #questions
Nextjs middleware being ignored
Where does
redirect(url, req)
comes from ? I believe you should return NextResponse.redirect(url)
instead6 replies