mirror of
https://github.com/JonasunderscoreJones/ArchSystemSetup.git
synced 2025-10-23 03:29:20 +02:00
added base project
This commit is contained in:
parent
2578670667
commit
228f31132c
8 changed files with 1797 additions and 0 deletions
48
worker.js
Normal file
48
worker.js
Normal 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 });
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue