Kickstart your Express.js projects with TypeScript, a powerful combination for building scalable and maintainable web applications.
- TypeScript: Utilize the benefits of static typing to catch errors early and enhance code maintainability.
- Express: Build robust and efficient web servers with the widely used Express framework.
- Middleware Integration: Out-of-the-box integration of essential middleware such as Helmet, Morgan, CORS, and Cookie Parser for improved security, logging, and request handling.
- Environment Configuration: Seamless configuration of environment variables using dotenv, allowing easy management of configurations across different environments.
- Routing: Define routes effortlessly and serve static files with ease using Express routing capabilities.
- Error Handling: Centralized error handling with customizable error middleware for better error management and response consistency.
- Deployment Ready: Configure port dynamically based on environment variables, making deployment hassle-free.
- Logging: Integrated HTTP request logging using Morgan middleware for enhanced debugging and monitoring.
- Clone this repository:
git clone https://github.com/codeAdityagithub/express-starter-ts.git
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Build for production:
npm run build
andnpm run start
.
├── src/
│ ├── controllers/
│ ├── middlewares/
│ ├── routers/
│ ├── models/
│ └── index.ts
├── public/
│ └── ...
├── types/
│ └── ...
├── .env.example
├── .gitignore
├── package.json
└── tsconfig.json
Contributions and suggestions are welcome! Feel free to fork this repository and submit pull requests to improve this starter template.