Skip to content

Commit

Permalink
v1.0.353
Browse files Browse the repository at this point in the history
  • Loading branch information
petervanderwalt committed Feb 23, 2023
1 parent 2d05221 commit 8350c74
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
v1.0.352: Fixed API integration for cam.openbuilds.com
v1.0.352: Added support for nodeIntegration (Additional backend support for awesome JS Macros)
v1.0.351: Updated defaults for Surfacing Wizard UI, Updated text on Recovery wizard
v1.0.350: Updated all dependencies, Updated to Node 18, Removed Drivelist Dependency
Expand Down
22 changes: 17 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ var fluidncConfig = "";
app.use(express.static(path.join(__dirname, "app")));
//app.use(express.limit('200M'));

app.use(function setCommonHeaders(req, res, next) {
res.set("Access-Control-Allow-Private-Network", "true");
next();
});

app.all('/*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.header("Access-Control-Allow-Private-Network", "true");
next();
});


// Interface firmware flash
app.post('/uploadCustomFirmware', (req, res) => {
Expand Down Expand Up @@ -501,7 +513,6 @@ var PortCheckinterval = setInterval(function() {

checkPowerSettings()


// JSON API
app.get('/api/version', (req, res) => {
res.header("Access-Control-Allow-Origin", "*");
Expand Down Expand Up @@ -593,8 +604,9 @@ app.post('/upload', function(req, res) {
});

form.on('fileBegin', function(name, file) {
debug_log('Uploading ' + file.name);
file.path = uploadsDir + file.name;
debug_log(JSON.stringify(name));
debug_log(JSON.stringify(file));
debug_log('Uploading ' + file.filepath);
});

form.on('progress', function(bytesReceived, bytesExpected) {
Expand All @@ -607,9 +619,9 @@ app.post('/upload', function(req, res) {
});

form.on('file', function(name, file) {
debug_log('Uploaded ' + file.path);
debug_log('Uploaded ' + file.filepath);
showJogWindow()
readFile(file.path)
readFile(file.filepath)
});

form.on('aborted', function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "OpenBuildsCONTROL",
"version": "1.0.352",
"version": "1.0.353",
"license": "AGPL-3.0",
"description": "OpenBuildsCONTROL CNC Machine Host Software",
"author": "github.com/openbuilds <support@openbuilds.com>",
Expand Down

0 comments on commit 8350c74

Please sign in to comment.