Skip to content

Commit

Permalink
Stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Gael Leblan committed Sep 2, 2020
1 parent 27c5692 commit 5940951
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ app.use(fileUpload());
app.use(cors());

app.get("/", function (req, res) {
res.send("Hello World!");
res.send("Baldr is awake and shining !");
});

app.post("/upload/:slicerType", function (req, res) {
console.log(req.files);

for (var i = 0; i < Object.keys(req.files).length; i++) {
var nameObject = Object.keys(req.files)[i];
var sampleFile = req.files[nameObject];
Expand All @@ -37,7 +35,6 @@ app.post("/upload/:slicerType", function (req, res) {
sampleFile.mv("/tmp/" + sampleFile.id + ".stl", function (err) {
if (err) return res.status(500).send(err);

var name = sampleFile.name.substring(0, sampleFile.name.lastIndexOf("."));
var options = {
inputFile: "/tmp/" + sampleFile.id + ".stl",
// For more options check out the configSchema.yaml file,
Expand All @@ -48,7 +45,6 @@ app.post("/upload/:slicerType", function (req, res) {
var callback = function (error) {
if (error) console.error(error.message);
else {
console.log(sampleFile.name);
let name = sampleFile.name.substring(0, sampleFile.name.lastIndexOf("."));
res.download("/tmp/" + sampleFile.id + ".gcode", name + ".gcode", () => {
fs.remove("/tmp/" + sampleFile.id + ".gcode");
Expand Down

0 comments on commit 5940951

Please sign in to comment.