Panth Patelhow-is-my-backend.whiteloves.in·Dec 1, 202410 Common Issues in Node.js to keep in MindIf you have a callback API function, fix it using the Promise constructor. function badImplementation() { return new Promise((resolve, reject) => { someOldLibWithCb((data, err) => { if (err) { reject(err); ...DiscussNode.js
Landaylanday.hashnode.dev·Nov 25, 2024使用zod时的注意:nullable vs optional定义zod schema的时候,有时候定义为nullable时要注意:如果你是从一个可能为空的对象里取出一个字段来parse的时候,可能会出现问题: const schema = z.object({ a: z.string().nullable() }); const rawData = { nested: null }; const data = schema.parse({ a: rawData.nested?.a }); 会导致throw,程序无法继续下去。 解决办法:...Discusszod
Pawan Gangwaniblogs.pgangwani.co.in·Nov 14, 2024Type-Safe React: Leveraging TypeScript and Zod for Better ApplicationsTypeScript and Zod together create a powerful combination for building type-safe React applications. While TypeScript provides static type checking, Zod adds runtime validation and automatic type inference. Let's explore how to effectively use these ...DiscussTypeScript
Emmanuel Obeng Twenedelinuxist.hashnode.dev·Oct 29, 2024Step-by-Step Guide to Fullstack Development with Next.js and Lucia AuthenticationIntroduction Authentication and authorization are crucial components of web security, ensuring that users can securely access resources within an application. Authentication is the process of verifying a user’s identity, while authorization determine...Discuss·28 readsfrontend
Kceekcee.hashnode.dev·Oct 18, 2024Enhance Your Express Applications with Zod LibraryExpress.js is a great framework for building web applications. It offers flexibility, and ease of use whilst being very robust. In this article, we will use Zod to enhance the features of a web API built with Express. Zod is a schema validation libra...DiscussAPI development
Harsh Kumar Raicodebyharsh.hashnode.dev·Oct 17, 2024Day 42: Web Development + DevOps JourneyDay 42: Web Development + DevOps Journey Today marked another milestone in my Web Development + DevOps journey, where I dived deeper into back-end development and security aspects, as well as error handling. Here's a quick summary of what I learned, ...Discuss#WebDevelopment #DevOps #MongoDB #Zod #ErrorHandling #Security #JavaScript #LearningJourney #Hashing #Testing
Rishi Bakshirishibakshi.hashnode.dev·Oct 9, 2024The Biggest Mistake You’re Making with Next.js Server Actions: Silent ThreatOne of the critical mistakes I learned in my Next.js journey is failing to validate and protect server actions. Server actions in Next.js can expose post routes, which can be vulnerable if not properly secured. When using server actions, it's essenti...Discuss·10 likesYou Don't Know Next.jsNext.js
Muhammad Kamil Razakamilraza.hashnode.dev·Oct 1, 2024Zod: A Data Validation LibraryIntroduction to Zod Zod is a powerful library for data validation in JavaScript and TypeScript. It helps ensure that your data meets certain criteria, making your applications more robust and error-free. Why Use Zod? Type Safety: Ensures that data c...Discusszod
Sheraz Manzoorsherazmanzoor.hashnode.dev·Oct 1, 2024Next.js Middleware Explained: Simple Guide with ExamplesLet's talk about routing in Nextjs. Today, we will talk about the one of most powerful thing middleware. Middleware in Nextjs offers a powerful and flexible way both to intercept requests from server and control requests flow (redirects, URL rewritin...DiscussNextjs TutorialsNext.js
Coding Corgicoding-corgi.hashnode.dev·Sep 29, 2024Notes 01 - React Hook Form + ZodLive demo link ( if the link is broken, you can always check the code below ) TL;DR we need zodResolver to integrate react-hook-form with Zod. If you are using other validation library, check the documentation here. refine comes in handy when you w...Discuss·10 likeszod