mirror of
https://github.com/sasjs/server.git
synced 2026-01-11 16:20:06 +00:00
feat(executor): response with webout
This commit is contained in:
@@ -48,15 +48,34 @@ router.post('/deploy', async (req, res) => {
|
||||
})
|
||||
})
|
||||
|
||||
router.post('/execute', async (req, res) => {
|
||||
if (req.body?._program) {
|
||||
await processSas(req.body)
|
||||
// TODO: respond with HTML page including file tree
|
||||
router.get('/SASjsExecutor', async (req, res) => {
|
||||
res.status(200).send({ status: 'success', tree: {} })
|
||||
})
|
||||
|
||||
// SAS:
|
||||
// https://sas.analytium.co.uk:8343/SASStoredProcess/do?_action=form,properties,execute,noba[…]blic%2Fapp%2Fdata-combiner%2Fservices%2Fcommon%2Fappinit
|
||||
// https://sas.analytium.co.uk:8343/SASStoredProcess/
|
||||
// https://sas.analytium.co.uk:8343/SASStoredProcess/do?&_program=%2FPublic%2Fapp%2Fdata-combiner%2Fservices%2Fcommon%2Fappinit&_DEBUG=131
|
||||
// https://sas.analytium.co.uk:8343/SASStoredProcess/do?_program=%2FPublic%2Fapp%2Fdata-comb[…]ction=update%2Cnewwindow%2Cnobanner&_updatekey=895432774
|
||||
|
||||
// SASjs:
|
||||
// http://localhost:5000/SASjsExecutor?_program=%2FPublic%2Fapp%2Fdata-combiner%2Fservices%2Fcommon%2Fappinit
|
||||
// http://localhost:5000/SASjsExecutor
|
||||
// http://localhost:5000/SASjsExecutor?_program=%2FPublic%2Fapp%2Fdata-combiner%2Fservices%2Fcommon%2Fappinit&_DEBUG=131
|
||||
|
||||
router.get('/SASjsExecutor/do', async (req, res) => {
|
||||
const queryEntries = Object.keys(req.query).map((entry: string) =>
|
||||
entry.toLowerCase()
|
||||
)
|
||||
const isDebug = queryEntries.find((entry: string) => entry === '_debug')
|
||||
? true
|
||||
: false
|
||||
|
||||
if (isRequestQuery(req.query)) {
|
||||
await processSas({ ...req.query, _debug: isDebug })
|
||||
.then((result) => {
|
||||
res.status(200).send({
|
||||
status: 'success',
|
||||
message: 'Job has been sent for execution.',
|
||||
...result
|
||||
})
|
||||
res.status(200).send(result)
|
||||
})
|
||||
.catch((err) => {
|
||||
res.status(400).send({
|
||||
|
||||
Reference in New Issue
Block a user