Commit 03acad38 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 5126950c
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
const express = require('express') const express = require('express')
const app = express() const app = express()
const port = 3000 const port = 3000
const shell=require('shelljs')
app.get('/', (req, res) => res.send('Hello World!')) app.get('/', (req, res) =>
{
res.send('Hello World!')
run()
})
app.listen(port, () => console.log(`Example app listening on port ${port}!`)) app.listen(port, () => console.log(`Example app listening on port ${port}!`))
async function run() {
let a = await shell.exec('cd .. && ls cd mt && sudo ./kill.sh && ./server1.sh', {silent: true}).stdout;
console.log(a)
}
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"start": "node ./bin/www" "start": "node ./bin/www"
}, },
"dependencies": { "dependencies": {
"express": "~4.16.0" "express": "~4.16.0",
"shelljs": "^0.8.3"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment