TypeScript | Union Types vs Enums
Learn the difference between using union types and enums in TypeScript with simple examples, as well as understanding when to use one or the other
Learn the difference between using union types and enums in TypeScript with simple examples, as well as understanding when to use one or the other
TypeScript has become an excellent alternative to prevent data type definition issues often found when working with JavaScript. Companies are migrating to TypeScript as the default programming language for their Node.js backend. However, developers struggle to set up local debugging configurations when using nodemon. In this article, you will learn how to fix that issue. … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. Getting Started First things first, we need to create the directory for our application: mkdir express-typescript Time to set up our package.json file where we can define all our … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. What is CRUD? CRUD stands for Create, Read, Update, and Delete and it is one of the most common operations done in software development. In fact, it is one … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. What is an Error Handler in Express.js? Error handlers in Express.js are in charge of catching and handing errors that happen during runtime. By default, Express.js provides with a … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. What Are Application-Level Middleware and Why Do We Need Them? Application-level middleware is a type of middleware that generally runs throughout the whole application. In the case of express.js, … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. Third-party middlewares are a good alternative when there is a package available out there offering functionality that our API will need such as allowing client access from different origins … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. What is a Middleware in Node.js/Express.js? A middleware is essential in the development of an application, in our case an API. As the name suggests, middleware is a process … Read more
Note: This post is part of Learn How to Use TypeScript With Node.js and Express.js series. Click here to see the first post of the series. Create API Endpoint Routes So far our server has only one API endpoint / which we defined in the index.ts returning a Hello World! message. app.get(‘/’, (req: Request, res: … Read more
Introduction to a typed RESTful API development experience JavaScript is the language of choice when it comes to frontend development for the web. Advances in web development have led to the rise of multiple libraries and frameworks such as Vue, React, Angular, Svelte, and many others. A long time ago, JavaScript was seen as the … Read more