1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-11 03:34:35 +00:00

feat: serve deployed streaming apps

This commit is contained in:
Saad Jutt
2022-03-15 03:54:19 +05:00
parent 940f705f5d
commit d6fa877941
7 changed files with 106 additions and 79 deletions

View File

@@ -0,0 +1,22 @@
import path from 'path'
import express from 'express'
import { getTmpFilesFolderPath } from '../../utils'
const router = express.Router()
export const publishAppStream = (appLoc: string[]) => {
const appLocUrl = encodeURI(appLoc.join('/'))
const appLocPath = appLoc.join(path.sep)
const pathToDeployment = path.join(
getTmpFilesFolderPath(),
appLocPath,
'services',
'webv'
)
router.use(`/${appLocUrl}`, express.static(pathToDeployment))
}
export default router