Commit c8823720 authored by nilanjandaw's avatar nilanjandaw

fixed file paths

parent 1f5318fb
......@@ -16,7 +16,7 @@ let db = new Map()
app.use(morgan('combined'))
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
const file_path = __dirname + "/repository"
const file_path = __dirname + "/repository/"
app.use('/repository', express.static(file_path));
app.use(fileUpload())
......@@ -42,7 +42,7 @@ app.post('/serverless/deploy', (req, res) => {
}
else {
if (runtime === "container") {
deployContainer('./test/', functionHash)
deployContainer('./repository/', functionHash)
.then(() => {
res.json({
status: "success",
......@@ -69,7 +69,7 @@ function deployContainer(path, imageName) {
return new Promise((resolve, reject) => {
let buildStart = Date.now()
fs.writeFile('./test/Dockerfile',
fs.writeFile('./repository/Dockerfile',
`FROM node:latest
WORKDIR /app
COPY package.json /app
......@@ -85,7 +85,7 @@ function deployContainer(path, imageName) {
}
else {
console.log('Dockerfile created');
const process = spawn('docker', ["build", "-t", imageName, path, "-q"]);
const process = spawn('docker', ["build", "-t", imageName, path]);
process.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
......
......@@ -15,6 +15,7 @@
"express-fileupload": "^1.1.6",
"isolated-vm": "^3.0.0",
"morgan": "^1.9.1",
"mqtt": "^3.0.0",
"nano": "^8.1.0",
"redis": "^2.8.0",
"save": "^2.4.0"
......
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