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:
22
api/src/routes/appStream/index.ts
Normal file
22
api/src/routes/appStream/index.ts
Normal 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
|
||||
Reference in New Issue
Block a user