-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
66 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@spotlightjs/overlay': patch | ||
'@spotlightjs/sidecar': patch | ||
--- | ||
|
||
Remove connect function from sidecar |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env node | ||
const fs = require('fs'); | ||
const http = require('http'); | ||
const path = require('path'); | ||
|
||
// Directory where the script is running | ||
const directoryPath = path.join(__dirname); | ||
|
||
// Function to read files and send data | ||
function sendData(filePath) { | ||
fs.readFile(filePath, 'utf8', (err, data) => { | ||
if (err) { | ||
console.error(`Error reading file ${filePath}: ${err}`); | ||
return; | ||
} | ||
|
||
const options = { | ||
hostname: 'localhost', | ||
port: 8969, | ||
path: '/stream', | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/x-sentry-envelope', | ||
}, | ||
}; | ||
|
||
const req = http.request(options, res => { | ||
console.log(`Status: ${res.statusCode}`); | ||
}); | ||
|
||
req.on('error', error => { | ||
console.error(`Problem with request: ${error.message}`); | ||
}); | ||
|
||
// Send the data | ||
req.write(data); | ||
req.end(); | ||
}); | ||
} | ||
|
||
// Read all .txt files from the directory | ||
fs.readdir(directoryPath, (err, files) => { | ||
if (err) { | ||
console.log('Unable to scan directory: ' + err); | ||
return; | ||
} | ||
|
||
files.forEach(file => { | ||
if (path.extname(file) === '.txt') { | ||
sendData(path.join(directoryPath, file)); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.