added base project

This commit is contained in:
Jonas_Jones 2024-10-23 21:46:38 +02:00
parent 2578670667
commit 228f31132c
8 changed files with 1797 additions and 0 deletions

48
worker.js Normal file
View file

@ -0,0 +1,48 @@
// 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 });
}
};