Skip to content

A basic Express server setup powered by TypeScript with Node.js.

License

Notifications You must be signed in to change notification settings

c99rahul/ts-node-express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript x Express x Node.js

This repository contains a basic TypeScript Express application that utilizes Node.js for server-side functionality. It is configured with Nodemon for automatic server restarts during development and uses ts-node for TypeScript execution.

If you are not familiar with a TypeScript workflow, consider checking out the JavaScript branch of this repository.

Feeling lost? Go through the tutorial that this repository is built upon.

Monitoring the Changes Detected By Nodemon

Prerequisites

Before you begin, ensure you have the following installed on your machine:

  • Node.js: Ensure that Node.js, preferably version 16 or higher, is installed on your system, as this project utilizes the latest versions of TypeScript and Nodemon.
  • npm: npm is the package manager for Node.js and comes with the Node.js installation.

Installation

Clone the repository to your local machine:

git clone https://github.com/c99rahul/ts-node-express.git

Navigate to the project directory:

cd ts-node-express/

Install the project dependencies including TypeScript and Nodemon:

npm i

Usage

For development purposes, you can run the application using Nodemon to automatically restart the server when changes are detected. Execute the following command:

npm run dev

This will start the server at http://localhost:3000 by default. You can change the port in the src/index.ts file or create an .env file to manage the environt-specific variables separately.

For production, you can build the TypeScript files and then start the server. Run the following commands:

npm run build
npm start

Project Structure

The project structure is organized as follows:

  • src: Contains TypeScript source files
    • index.ts: Configures and starts the Express application
  • dist: Output directory created during build for compiled TypeScript files
  • package.json: Project configuration and dependencies
  • tsconfig.json: TypeScript configuration

You can customize the project configuration i nthe tsconfig.json file and adjust the server settings in the src/index.ts file.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A basic Express server setup powered by TypeScript with Node.js.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published