30 lines
535 B
JavaScript
30 lines
535 B
JavaScript
const express = require('express')
|
|
const app = express()
|
|
const port = 3000
|
|
|
|
app.use(express.static("public"))
|
|
|
|
const documentRoot = `${__dirname}/httpdocs`
|
|
|
|
|
|
app.get('/', (req, res) => {
|
|
res.sendFile(documentRoot+"/index.html")
|
|
})
|
|
|
|
app.get("/execute", (req, res)=> {
|
|
const raw_command = req.body.command;
|
|
const formatted_command = toString(raw_command).trim()
|
|
if (formatted_command.startsWith("ls")){
|
|
|
|
}
|
|
})
|
|
|
|
app.listen(port, () => {
|
|
console.log(`Example app listening on port ${port}`)
|
|
})
|
|
|
|
|
|
|
|
function LS () {
|
|
|
|
} |