title: Serve static files with ExpressJS Typescript NodeJS
body: <p>I'm trying to serve static file uploaded using ExpressJS and NodeJS with Typescript but getting 404 error.</p>
  <p>the file I want to read is ./src/data/uploads/test.txt and I'm trying to access it from web browser directly.</p>
  <p>Note: When I do it in Javascript it worked but not in Typscript.</p>
  <p>index.ts file (app entry point)</p>
  <pre><code>import express from 'express';
  import bodyParser from 'body-parser';
  import helmet from 'helmet';
  import {cdg, config} from './utils';
  import {Mongoose} from './db/monogdb';
  import { setRoutes } from './routes/route.decorators';
  import cors from 'cors';
  import './routes';
  
  const app = express();
  
  app.use(helmet());
  app.use(cors());
  app.use(bodyParser.urlencoded({ extended: true }));
  app.use(bodyParser.json());
  app.use('/ftp', express.static('data/uploads'));
  
  setRoutes(app);
  
  app.listen(config.server.port, () =&gt; {
      cdg.konsole(&quot;Server connected! :: &quot; + config.server.port + &quot;!&quot;);
  });
  
  </code></pre>
  <p>Is there a specific way to serve static file with Typescript ?</p>