|
|
|
@ -1,7 +1,4 @@
|
|
|
|
|
import path, { join } from 'path'; |
|
|
|
|
import { Injectable } from '@nestjs/common'; |
|
|
|
|
import express from 'express'; |
|
|
|
|
import isDocker from 'is-docker'; |
|
|
|
|
import type { NestMiddleware } from '@nestjs/common'; |
|
|
|
|
|
|
|
|
|
@Injectable() |
|
|
|
@ -12,12 +9,5 @@ export class PublicMiddleware implements NestMiddleware {
|
|
|
|
|
const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard'; |
|
|
|
|
return res.redirect(dashboardPath); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// serve static files from public folder
|
|
|
|
|
if (isDocker()) { |
|
|
|
|
express.static(join(process.cwd(), 'docker', 'public'))(req, res, next); |
|
|
|
|
} else { |
|
|
|
|
express.static(join(process.cwd(), 'public'))(req, res, next); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|