mirror of
https://github.com/KeygraphHQ/juice-shop.git
synced 2026-11-07 11:06:06 -10:00
20 lines
592 B
TypeScript
20 lines
592 B
TypeScript
/*
|
|
* Copyright (c) 2014-2025 Bjoern Kimminich & the OWASP Juice Shop contributors.
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
import path from 'node:path'
|
|
import { type Request, type Response, type NextFunction } from 'express'
|
|
|
|
import * as utils from '../lib/utils'
|
|
|
|
export function serveAngularClient () {
|
|
return ({ url }: Request, res: Response, next: NextFunction) => {
|
|
if (!utils.startsWith(url, '/api') && !utils.startsWith(url, '/rest')) {
|
|
res.sendFile(path.resolve('frontend/dist/frontend/index.html'))
|
|
} else {
|
|
next(new Error('Unexpected path: ' + url))
|
|
}
|
|
}
|
|
}
|