Dexter  Goodwin

Dexter Goodwin


How to use ExpressJs with Typescript

Take a look at how you could use the web framework expressJs with typescript


If you are here I am assuming you already know what expressJs, javascript, node, and typescript are. I am also assuming that you have node and npm installed. So I will not go in deep about that.

In this article, we will go through the setup to get you started with expressJs with typescript. We also go into the details on what are the controllers, middleware, services, routes, etc.

Let’s get started!

Start new NPM project and install the dependencies

  • Create a new folder for your project, open your terminal, and type:
npm init

This command will ask you for some input. Respond as you like (it’s not relevant for this guide).

  • Now install the dependencies:
npm i express express-winston winston debug cors — save
  • Install the dev dependencies
npm i @types/cors @types/debug @types/express @types/node nodemon source-map-support tslint typescript --save-dev

#tutorial #javascript #typescript #programming #expressjs

How to use ExpressJs with Typescript