This commit is contained in:
Stijnus
2025-01-22 02:05:18 +01:00
parent a94330e4a4
commit 723c6a4f02
4 changed files with 302 additions and 95 deletions

View File

@@ -1,4 +1,4 @@
import type { ActionFunctionArgs } from '@remix-run/cloudflare';
import type { ActionFunctionArgs, LoaderFunction } from '@remix-run/cloudflare';
import { json } from '@remix-run/cloudflare';
interface PackageJson {
@@ -27,6 +27,23 @@ const packageJson = {
},
} as PackageJson;
export const loader: LoaderFunction = async ({ request: _request }) => {
try {
return json({
name: packageJson.name,
version: packageJson.version,
description: packageJson.description,
license: packageJson.license,
nodeVersion: process.version,
dependencies: packageJson.dependencies,
devDependencies: packageJson.devDependencies,
});
} catch (error) {
console.error('Failed to get webapp info:', error);
return json({ error: 'Failed to get webapp information' }, { status: 500 });
}
};
export const action = async ({ request: _request }: ActionFunctionArgs) => {
try {
return json({