mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 16:19:12 +00:00
- Remove installers/ directory (install.sh, install.ps1, uninstall.sh, uninstall.ps1) - Update CloudFlare worker to 301 redirect /install* to npm docs - Remove detectInstallationMethod() - npm is now only install method - Simplify update-command.ts to npm-only updates - Clean up tests to remove direct install references BREAKING CHANGE: Native shell installers (curl/irm) no longer work. Use `npm install -g @kaitranntt/ccs` instead.
26 lines
808 B
JavaScript
26 lines
808 B
JavaScript
/**
|
|
* CCS CloudFlare Worker - Redirect to npm Installation
|
|
*
|
|
* Legacy shell installers are deprecated. This worker now redirects
|
|
* all /install* and /uninstall* requests to the npm installation docs.
|
|
*/
|
|
export default {
|
|
async fetch(request) {
|
|
const url = new URL(request.url);
|
|
const docsUrl = 'https://docs.ccs.kaitran.ca/getting-started/installation';
|
|
|
|
// Redirect all install/uninstall paths to npm installation docs
|
|
if (
|
|
url.pathname === '/install' ||
|
|
url.pathname === '/install.sh' ||
|
|
url.pathname === '/install.ps1' ||
|
|
url.pathname === '/uninstall' ||
|
|
url.pathname === '/uninstall.sh' ||
|
|
url.pathname === '/uninstall.ps1'
|
|
) {
|
|
return Response.redirect(docsUrl, 301);
|
|
}
|
|
|
|
return new Response('Not Found', { status: 404 });
|
|
}
|
|
}; |