Serve static files

@ServerSettings let you to configure a list of static folders.

Installation

Install the serve-static module:

npm install --save serve-static @tsed/servestatic

Then configure your server:

import {ServerLoader, ServerSettings} from "@tsed/common";
import "@tsed/servestatic";
import Path = require("path");
const rootDir = Path.resolve(__dirname)

@ServerSettings({
   rootDir,
   serveStatic: {
      "/": `${rootDir}/webapp`
   }
})
export class Server extends ServerLoader {

}

TIP

serveStatic attributes supports multiple directories