This is a simple API server built with TypeScript and Express, handling only one API endpoint. It also includes a build script to copy configuration files and clean the build directory before compiling.
npm installnpm run servenpm run buildnpm startThe build.js script performs the following steps:
- Deletes the
dist/folder (to ensure a clean build). - Compiles TypeScript files into JavaScript.
- Copies the
web.configfile todist/(for IIS deployment).
"scripts": {
"dev": "nodemon src/server.ts",
"build": "node build.js",
"start": "node dist/server.js"
}rimrafis used to clean thedist/folder before rebuilding.build.jsensures theweb.configis copied after compilation.- The server runs in
dist/after building.
This setup ensures smooth development and deployment to IIS or any Node.js server. 🚀