Giter Club home page Giter Club logo

minimal-express-typescript's Introduction

minimal-express-typescript

Minimal express app written in typescript that includes npm scripts to lint, compile and copy assets to dist directory and the ability to run the app in the vscode debugger.

Setup

npm install
npm start

Browse to http://localhost:3000 and http://localhost:3000/users/:user

Debugging

  1. Create vscode debug config .vscode/launch.json
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "npm run debug:start",
      "runtimeExecutable": "npm",
      "runtimeArgs": [
        "run-script",
        "debug:start"
      ],
      "port": 9229,
      "outputCapture": "std"
    }
  ]
}
  1. Set a breakpoint in the top of ./src/app.ts
  2. Click run
  3. Select "npm run debug:start" from the dropdown
  4. Click play

Credits

I got a lot of information for this setup from several different articles:

General express / typescript articles:

Use TypeScript to Build a Node API with Express

TypeScript Express tutorial

How (and why) you should use TypeScript with Node and Express.

How to set up an Express.js API using Webpack and TypeScript.

Create a server with Nodemon + Express + Typescript

With VSCode debug instructions:

Visual Studio Code: Node.js with TypeScript and Debugging

Debugging TypeScript in VS Code without compiling, using ts-node

Debugging Node.js apps in TypeScript with Visual Studio Code

How to Debug Nodejs, TypeScript Code in VSCode

minimal-express-typescript's People

Contributors

mjgs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.