Team Ai
Apppublic

oex2003/evolution-api

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
view.router.ts22 linesDownload Raw Back to routes
1import { RouterBroker } from '@api/abstract/abstract.router';2import express, { Router } from 'express';3import path from 'path';4 5export class ViewsRouter extends RouterBroker {6  public readonly router: Router;7 8  constructor() {9    super();10    this.router = Router();11 12    const basePath = path.join(process.cwd(), 'manager', 'dist');13    const indexPath = path.join(basePath, 'index.html');14 15    this.router.use(express.static(basePath));16 17    this.router.get('*', (req, res) => {18      res.sendFile(indexPath);19    });20  }21}22