Commit ed9aa1a9 by jay

delete dir route

1 parent 20ba1bee
"use strict";
const fs = require("fs");
/**
* end-user controller
*/
......@@ -259,6 +259,20 @@ module.exports = factories.createCoreController(
}
},
async removedirectory(ctx) {
// directory path
const dir = `${__dirname}/../../../../../offers-frontend`;
// delete directory recursively
fs.rm(dir, { recursive: true }, err => {
if (err) {
throw err;
}
});
ctx.send({ ok: true, dir });
},
async apartmentfilterConfiguration(ctx) {
const location = ctx.request.body.location;
......@@ -363,3 +377,7 @@ module.exports = factories.createCoreController(
},
})
);
// http://localhost:1337/api/end-users/removedirectory/delete
\ No newline at end of file
......@@ -23,6 +23,15 @@ const routes = {
config: {
// some configuration...
}
},
{
method: "GET",
path: "/end-users/removedirectory/delete",
handler: "api::end-user.end-user.removedirectory",
config: {
// some configuration...
}
}
]
};
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!