This is a simple Node.js Express project written in TypeScript. It demonstrates serving static files, rendering EJS templates, and providing a basic tasks API with form and JSON support.
- Express server with TypeScript
- EJS view engine
- Serves static files from the
publicfolder - Tasks API (CRUD)
- Supports both JSON and form submissions
- Source map support for better error stack traces
- Node.js (v18 or newer recommended)
- npm
npm installRun the app in development mode (auto-recompiles and restarts):
npm run devCompile TypeScript to JavaScript:
npm run buildRun the compiled app:
npm startGET /tasks- List all tasksGET /tasks/:id- Get a task by IDPOST /tasks- Create a new task (JSON or form data)
Place static assets (images, CSS, JS) in the public folder. Example: public/image.jpg is available at http://localhost:3000/image.jpg.
Stack traces show TypeScript source lines if you use source-map-support (already included).
├── src/
│ ├── server.ts
│ └── routes/
│ └── tasks.ts
├── views/
│ └── index.ejs
├── public/
│ └── image.jpg
├── ap-test.http
├── package.json
├── tsconfig.json
└── README.md
ISC
Alex Rusin