Skip to content

Commit 8acce0b

Browse files
committed
Update license and code
1 parent d598eae commit 8acce0b

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 JustCoded
3+
Copyright (c) 2026 JustCoded
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

server.js

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,47 @@ const server = prerender({
99
'--disable-gpu',
1010
'--remote-debugging-port=9222',
1111
'--hide-scrollbars',
12-
'--disable-dev-shm-usage'
12+
'--disable-dev-shm-usage',
13+
'--ignore-certificate-errors',
14+
'--allow-insecure-localhost'
1315
]
1416
});
1517

1618
process.env.CACHE_MAXSIZE = process.env.CACHE_MAXSIZE || 1000;
1719
process.env.CACHE_TTL = process.env.CACHE_TTL || 43200;
1820

21+
server.use({
22+
tabCreated: (req, res, next) => {
23+
const tab = req.prerender.tab;
24+
25+
if (tab) {
26+
tab.Console.enable();
27+
tab.Network.enable();
28+
29+
tab.Console.messageAdded((params) => {
30+
console.log('🟡 Browser log:', params.message.text);
31+
});
32+
33+
tab.Network.loadingFailed((params) => {
34+
console.log('🔴 Network Failed:', params.errorText, params.url);
35+
});
36+
37+
tab.Runtime.enable();
38+
tab.Runtime.exceptionThrown((exception) => {
39+
console.log('💥 JS Exception:', exception.exceptionDetails.text);
40+
});
41+
}
42+
43+
next();
44+
}
45+
});
46+
47+
48+
49+
50+
server.use(prerender.removeScriptTags());
51+
1952
server.use(memoryCache);
2053

21-
console.log('Prerender on Node 24 is starting...');
22-
server.start();
54+
console.log('Prerender on Node 24 starting...');
55+
server.start();

0 commit comments

Comments
 (0)