To create a Node.js Express web application with TypeScript, you need to follow these steps:
npm init -y
npm install express typescript ts-node @types/express --save-dev
tsconfig.json
file with the following contents:227 chars16 lines
src
folder and a server.ts
file inside it with the following contents:index.ts344 chars15 lines
views
folder inside the project root with an index.ejs
file that looks like this:154 chars11 lines
package.json
file that will build and run the application:63 chars6 lines
npm start
This will start the application on port 3000 and render the index.ejs
view with the title 'Express with TypeScript'.
gistlibby LogSnag