Update index.js
Browse files
index.js
CHANGED
|
@@ -35,7 +35,15 @@ app.all(
|
|
| 35 |
)
|
| 36 |
|
| 37 |
app.get('/shell', async (req, res) => {
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
})
|
| 40 |
|
| 41 |
app.get('/ss', async (req, res) => {
|
|
|
|
| 35 |
)
|
| 36 |
|
| 37 |
app.get('/shell', async (req, res) => {
|
| 38 |
+
const { q = 'neofetch --stdout' } = req.query
|
| 39 |
+
let output
|
| 40 |
+
try {
|
| 41 |
+
output = await execPromise(q)
|
| 42 |
+
} catch (e) {
|
| 43 |
+
output = e
|
| 44 |
+
} finally {
|
| 45 |
+
res.json(output)
|
| 46 |
+
}
|
| 47 |
})
|
| 48 |
|
| 49 |
app.get('/ss', async (req, res) => {
|