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
This commit is contained in:
9
routes/api/npmregistry.ts
Normal file
9
routes/api/npmregistry.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Handlers } from "$fresh/server.ts";
|
||||
|
||||
export const handler: Handlers<any, { data: string }> = {
|
||||
async GET(_req, ctx) {
|
||||
const registryResponse = await fetch('https://registry.npmjs.org/@angular/core');
|
||||
const data = await registryResponse.json();
|
||||
return Response.json({data});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user