mirror of
https://github.com/JonasunderscoreJones/ArchSystemSetup.git
synced 2025-10-22 19:19:20 +02:00
48 lines
1.9 KiB
JavaScript
48 lines
1.9 KiB
JavaScript
// index.js (or worker.js)
|
|
export default {
|
|
async fetch(request) {
|
|
const url = new URL(request.url);
|
|
|
|
// Check if the request path is '/'
|
|
if (url.pathname === '/') {
|
|
// Fetch the shell script file
|
|
const script = await fetch('https://raw.githubusercontent.com/JonasunderscoreJones/ArchSystemSetup/refs/heads/master/syssetup.sh');
|
|
const scriptText = await script.text();
|
|
|
|
return new Response(scriptText, {
|
|
headers: {
|
|
'Content-Type': 'text/plain', // Set the correct content type
|
|
'Cache-Control': 'no-store' // Optional: Prevent caching
|
|
}
|
|
});
|
|
}
|
|
|
|
if (url.pathname === '/flatpaks') {
|
|
// Fetch the shell script file
|
|
const script = await fetch('https://raw.githubusercontent.com/JonasunderscoreJones/ArchSystemSetup/refs/heads/master/flatpaks.txt');
|
|
const scriptText = await script.text();
|
|
|
|
return new Response(scriptText, {
|
|
headers: {
|
|
'Content-Type': 'text/plain', // Set the correct content type
|
|
'Cache-Control': 'no-store' // Optional: Prevent caching
|
|
}
|
|
});
|
|
}
|
|
|
|
if (url.pathname === '/packages') {
|
|
// Fetch the shell script file
|
|
const script = await fetch('https://raw.githubusercontent.com/JonasunderscoreJones/ArchSystemSetup/refs/heads/master/packages.txt');
|
|
const scriptText = await script.text();
|
|
|
|
return new Response(scriptText, {
|
|
headers: {
|
|
'Content-Type': 'text/plain', // Set the correct content type
|
|
'Cache-Control': 'no-store' // Optional: Prevent caching
|
|
}
|
|
});
|
|
}
|
|
|
|
return new Response('Not Found', { status: 404 });
|
|
}
|
|
};
|