Files
cypress/packages/server/lib/controllers/static.ts
Lachlan Miller 8bda0a9d02 chore: merge in develop to unified-desktop-gui (#18103)
* merge in develop

* remove accidentally merged file

* update types
2021-09-15 16:24:28 +10:00

13 lines
316 B
TypeScript

import send from 'send'
import type { Request, Response } from 'express'
import { getPathToDist } from '@packages/resolve-dist'
export const staticCtrl = {
handle (req: Request, res: Response) {
const pathToFile = getPathToDist('static', req.params[0])
return send(req, pathToFile)
.pipe(res)
},
}