nobody
Explore posts from serversHow to install npm dev dependencies?
I try to install
keysely-codegen
using deno add -D npm:kysely-codegen
but everytime it adds the dependency to my regular imports in the deno.json
, which looks like this:
what am I doing wrong here? I still have a hard time how the npm stuff works with deno3 replies
CDCloudflare Developers
•Created by nobody on 5/23/2024 in #workers-help
CF as my backend. How to solve auth for mobile apps?
I am building a mobile app and I'd like to use CF as my backend. So I wanna use Workers, D1 and so on. The frontend is a Flutter app.
My problem: How can I solve the auth problem? My initial plan was to use Firebase Auth and then use the Firebase admin sdk to verify a user within a worker. Sadly the Firebase admin sdk is not edge compatible.
How would you solve this problem? I want to use multiple auth flows (Apple, Google, Mail).
Authjs
has a core
package which can be used in CF Workers but it is still experimental..3 replies
CDCloudflare Developers
•Created by nobody on 5/6/2024 in #pages-help
How to use MDX on CF Pages?
I am trying to use CF Pages for my Next.js blog. I use MDX for that. I followed the instructions from Vercel (https://nextjs.org/docs/app/building-your-application/configuring/mdx)
and this is my
next.config.mjs
:
when I use the simple next dev
everything works fine. But the following error shows up If i simulate the CF Pages with the preview command (during compilation):
I tried to add the runtime config to the .mdx
files, but It does not change anything.
this is my mdx-components.tsx
:
I appreciate any kind of feedback on that. I tried to lookup old threads, but I did not found a solution to this2 replies
DTDrizzle Team
•Created by nobody on 9/27/2023 in #help
How to use drizzle as a sql builder?
I want to use drizzle with planet scale. Sadly for mysql drizzle does not support the returning function (although databasejs returns e.g the insertedId after an insert statement). Anyways I would be more than happy to just use drizzle as a SQL builder so I can pass the SQL to planet scale through databasejs. Any ideas how to achieve that? Awesome library by far, keep up the great work!
3 replies
❔ Runtime reflection on Asp .net core 7.0 missing
Hi, I am writing a generator which is used to generated api endpoints in a highly unified way. For that I need to be able to add data annotations to specific parameters. The Generator works fine, but when I add e.g the [FromBody] data annotation, it crashes with the following error:
Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
And this is the code:
`
This occurs when I retrieve the type of a AspNetCore data annotation. There is no nuget packaged which I could include in order to make the types known in my generator project. Any suggestions?2 replies
❔ Why does the JsonSerializer.Deserialize return a nullable object
I found this following example in the docs about the deserializer:
based on the docs it looks like it would throw an exception if the json can't be deserialized. The type, for deserialization, in this case is
WeatherForecase
not WeatherForecast?
. Why does it return nullable<..>? Is there a way to make it return the acutal instance or just throw an error? I want to avoid many (maybe unnecessary) null checks?
Thx!6 replies
❔ Source generator for creating REST Api
I want to create a REST endpoint for my entity classes.
Structure:
Backend.Api (contains asp net core logic, endpoints etc.)
Backend.Database (DB-Layer using EF Core, Entity classes)
Now I want to annotate my entity classes with a specific annotation (lets say
[HasEndpoint]
) and create the specific endpoint in the Backend.Api
project. But the source generator will create the endpoints in the Backend.Database
project.. How would it be possible to create the endpoints in Backend.Api
using the entities in Backend.Database
?10 replies
Are exceptions really that slow? - with .NET gRPC
I am building a server base on gRPC. In all docs about gRPC + C# there is the suggested method for error handling to simply throw a
RpcException
to expose information to the client. But I always thought throwing an exception is extremely bad performance wise? I mean throwing an exception for a simple validation failure on the clients input data (REST eq: return BadRequest()
) seems a bit too much, right? Or is that not really a big deal?14 replies
Will this service will be disposed using DependencyInjection?
I have the following class which is added to the default DI-container (Blazor WASM)
and In my classes I simply do
the
TestClass
itself will be instantiated by the DI as well. Will the disposed method of the GrpcService will be called?3 replies
Source Generator only annotate method instead of class
Is it possible to annotate only a method with a custom attribute instead of the class itself?
HasAttribute
is a custom method which simply checks for the attribute, for classes it works just fine - for method it does not.. Would that be the right way? Assuming that HasAttribute
works fine for methods too20 replies
How to use .NET 7 preview?
I am trying to use .NET7 (Version:
7.0.100-preview.7.22377.5
) and I am using VS 2022 (latest preview), but when I set my project to .net7 it uses the .NET7 RC1 as version? I wanna test the IRouteHandlerFilter
which got merged past preview 3.11 replies
PartialType from Nest.js in Csharp
Is there is a possibility to recreate a behaviour like the partialType from Nestjs (=> https://docs.nestjs.com/openapi/mapped-types#partial )? This is used to create a DTO from an existing DTO which has the same properties but all are optional. Perfect for a PostCustomerDto where all properties have to be provided, and the UpdateCustomerDto has the same but nullable. I am a nodejs dev starting with .NET
1 replies