I am a Dev
Explore posts from serversHello, is there any way to create a base router with common procedures? like an interface
I want all routers that use it have the state procedure (subscriptions), so I can create a common hook later
Although the implementation of the methods is completely different on each router, I just want to guarantee that they have those procedures, like an interface
The hook basically will subscribe to the state on mount, and unsubscribe on unmount
Thanks
8 replies
TTCTheo's Typesafe Cult
β’Created by I am a Dev on 10/5/2023 in #questions
with t3 what do you use to stream open ai chat gpt responses?
Since tRPC currently does not support it.
Thanks
4 replies
DTDrizzle Team
β’Created by I am a Dev on 10/3/2023 in #help
Drizzle support SELECT FOR UPDATE of postgres to avoid logical race conditions ?
I have a similar use case like this: https://on-systems.tech/blog/128-preventing-read-committed-sql-concurrency-errors/
Currently I use a mutex in my node main process, but I think is better to move this to the db.
If is possible can you show me a minimal example
Thank you so much
23 replies
Review of inner and outer context with express
Hello, I didn't find any example that uses inner (for testing) and outer context with express.
That's how I implemented it for my express trpc boilerplate, I wanted to know if I did it right, or if there was some error.
Thank you so much
TLDR;
The inner context and options is a custom object with partial express options.
the outer context and options is an extension of the inner but now the express options are mandatory.
2 replies
In the context should I put all my dependencies for my endpoint handlers?
For example I have the end point 'getStuff`
In this endpoint the handler call 3 party apis and map the data to the tRPC output.
But I have an API key rotator class, to do each request to a 3 party API with the different API key in each request.
So should I put in the context the API key rotator class?
And this should be a singleton like the db instance?
Also the API key rotator has dependency on the db, to store the last used API key, and consult all API keys.
Thanks
2 replies
How to return a stream? like open ai api
I want that my api can have stream responses like open ai
https://github.com/openai/openai-node#streaming-responses
how can i do it?
Thanks
5 replies
is there a simple boilerplate that has everything ready to deploy?
For example nodemon, reading the port for .env, etc. (I don't know if that's how it is haha)
I use turborepo, so can be an internal package.
But I want to see how the project configuration looks for the deploy.
It's the first time I am creating a server, for now it will be deployed on a PC on an intranet.
It's just a server to everyone in the intranet can access and modify a json file.
Thanks
4 replies
PD𧩠Plasmo Developers
β’Created by I am a Dev on 9/19/2023 in #π°newbie
There is a difference in the developer experience building the options page vs normal web with vite?
Hello, for now I want to develop an app in the options tab, the idea is to open it as if I were developing a web app with Vite.
There I will use, react-router, redux, etc, like a normal web app.
My question is if my development experience in that tab is the same as when developing a regular web app with vite, or does it have any limitations or differences that cause the app to restart, or lose state while developing.
Basically I'm just migrating a web app to the extension's options window, so I want to know if it's better to develop it in Vite as a web app, or is it the same DX with Plasmo.
Thanks
3 replies