Skip to content

Simple starter template for ExpressJs and TypeScript based on expressjs/generator and TypeScript-Node-Starter

License

Notifications You must be signed in to change notification settings

cdash04/express-ts-template

 
 

Repository files navigation

Express TypeScript template

Pre-reqs

  npm install -g yarn

Getting started

  • Install dependencies
  yarn install
  • Build and run the project
  yarn build
  yarn start
  • Run the project on dev mode (watch)
  yarn watch

Navigate to http://localhost:3000

Using the debugger in VS Code

Debugging is one of the places where VS Code really shines over other editors. Node.js debugging in VS Code is easy to setup and even easier to use. This project comes pre-configured with everything you need to get started.

When you hit F5 in VS Code, it looks for a top level .vscode folder with a launch.json file. In this file, you can tell VS Code exactly what you want to do:

{
  "type": "node",
  "request": "attach",
  "name": "Attach by Process ID",
  "processId": "${command:PickProcess}",
  "protocol": "inspector"
}

This is mostly identical to the "Node.js: Attach by Process ID" template with one minor change. We added "protocol": "inspector" which tells VS Code that we're using the latest version of Node which uses a new debug protocol.

With this file in place, you can hit F5 to attach a debugger. You will probably have multiple node processes running, so you need to find the one that shows node dist/server.js. Now just set your breakpoints and go!


Based on TypeScript Node Starter and Express Generator

About

Simple starter template for ExpressJs and TypeScript based on expressjs/generator and TypeScript-Node-Starter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 90.1%
  • JavaScript 9.9%