Skip to content

Commit

Permalink
bumping
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonhochkins committed Jul 2, 2024
1 parent 6897f64 commit 4c6aab7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hakit/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Hakit",
"version": "1.0.12",
"version": "1.0.13",
"slug": "hakit",
"init": false,
"ingress": true,
Expand Down
7 changes: 5 additions & 2 deletions hakit/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,25 @@ async function loadConfig() {
if (!fs.existsSync(NEXTJS_DIR)) {
fs.mkdirSync(NEXTJS_DIR);
}
console.log('downloading')

// Fetch the zip file
const response = await axios({
url: fileUrl,
method: 'GET',
responseType: 'stream'
});
console.log('downloaded')

// Pipe the zip file to unzipper
response.data.pipe(unzipper.Extract({ path: NEXTJS_DIR }))
.on('close', () => {
console.log('Next.js application extracted successfully');
res.status(200).send('Next.js application downloaded and extracted successfully');
})
.on('error', (err: string) => {
console.error('Error extracting Next.js application:', err);
.on('error', (err: Error) => { // Change the type to capture full error object
console.error('Error extracting Next.js application:', err.message);
// console.error('Error stack:', err.stack);
res.status(500).send('Error extracting Next.js application');
});

Expand Down

0 comments on commit 4c6aab7

Please sign in to comment.