Server folder in create-t3-app

I am not using nextjs custom server (server folder).I am using my backend code api. Is there any way to create-t3-app without it,or I need to delete it and manage the files there on my own?
12 Replies
Matvey
Matvey2y ago
Just generate a t3 app with tailwind only
migolko_anton
migolko_anton2y ago
But if I want to use trpc? @Ronan
julius
julius2y ago
Why would you not want to use the server folder to separate your routers then?
migolko_anton
migolko_anton2y ago
I use the api points @julius
julius
julius2y ago
Inlining router in the trpc slug file will get very messy after some time Well yes the slug route will expose the api but its good practice to separate the router into multiple files
migolko_anton
migolko_anton2y ago
So for what usage I have api folder and server folder...i mean when to use each? @julius
julius
julius2y ago
trpc expose all your procedures under a single next api endpoint
julius
julius2y ago
GitHub
trpc/[trpc].ts at main · trpc/trpc
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/[trpc].ts at main · trpc/trpc
julius
julius2y ago
and you pass in your router
julius
julius2y ago
GitHub
trpc/_app.ts at main · trpc/trpc
🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy. - trpc/_app.ts at main · trpc/trpc
julius
julius2y ago
that export default trpcNext.crerateNextApiHandler is a next api endpoint handler export default function handler(req, res) { // magic in here } that handles all the requests you define in your router's procedures
migolko_anton
migolko_anton2y ago
Got you!!! Thanks
Want results from more Discord servers?
Add your server