Recently, I have been working the lot with Node.js and TypeScript. And I absolutely love TypeScript due to its features. I was actually looking for a boilerplate code to start which should be very easy to understand. But there was no code there. So I decided to create a minimum web application structure. I have used it in some project and I was quite happy with it.
So I thought why should I make it open source so that people can also get benefited by this. So here I am presenting A minimal Web Application Structure with technologies like Node.js, TypeScript, and Express.
You can find the complete source code on Github at following location - https://github.com/dotnetjalps/minimum-nodejs-typescript-express
So I thought why should I make it open source so that people can also get benefited by this. So here I am presenting A minimal Web Application Structure with technologies like Node.js, TypeScript, and Express.
You can find the complete source code on Github at following location - https://github.com/dotnetjalps/minimum-nodejs-typescript-express
How to Run this Project:
To run this project you need to first install all the NPM packages via the following command.npm installThen you can run this project with the following command.
npm start
Directory Structure Of Project:
- App.ts – Typescript file for creating express application class and where we have initialized the application.
- routes.ts - Typescript files for creating all the routes under Init() Method.
- package.json - Contains all the packages and dev dependencies required for this application. You can add more as your requirement.
- tsconfig.json - Where all the typescript configuration is there and we converting typescript into ES5.
- Controller Folder - Contains all the classes for the controller of the express application
- tsconfig.josn - Contains all the rules for TypeScript linting.