To inlude and exclude files as defined in tsconfig.json at the time of starting the server, You have to use files option with ts-node as described in ts-node npmjs
use one of the following command to start the server:
npx ts-node --files ./src/index.ts
or
npx nodemon --exec "ts-node --files" ./src/index.ts