From fc0064f6a0ed4c66a726a93786f7e1bb39bcfe80 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 13 May 2023 11:17:27 +0530 Subject: Initial Commit * Implements Basic Routing and API * Implements Package.json file select and json parse * Displays Project Name, Version & Desc from the package.json * Fetch all package details using npm registry API and map it based on package name --- routes/api/npmregistry.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 routes/api/npmregistry.ts (limited to 'routes/api/npmregistry.ts') diff --git a/routes/api/npmregistry.ts b/routes/api/npmregistry.ts new file mode 100644 index 0000000..366e3bf --- /dev/null +++ b/routes/api/npmregistry.ts @@ -0,0 +1,9 @@ +import { Handlers } from "$fresh/server.ts"; + +export const handler: Handlers = { + async GET(_req, ctx) { + const registryResponse = await fetch('https://registry.npmjs.org/@angular/core'); + const data = await registryResponse.json(); + return Response.json({data}); + }, +}; -- cgit v1.2.3