Skip to content

Commit

Permalink
remove unneeded files in chainlink api
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeirojose committed May 17, 2024
1 parent eb97d22 commit c8f0a7b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 171 deletions.
3 changes: 0 additions & 3 deletions apps/chainlink-datafeeds-api/.eslintrc.json

This file was deleted.

37 changes: 6 additions & 31 deletions apps/chainlink-datafeeds-api/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Chainlink Datafeeds API

## Getting Started
This is a small wrapper around Chainlink's [DataFeeds](https://data.chain.link/feeds) page to expose its data through an API.

First, run the development server:
## Warning

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
⚠️ This API is experimental and may break at any time. Use it at your own risk. Ensure to have fallback mechanisms in place if you rely on this data for critical operations.

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## How It Works

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
The API pulls raw HTML content from the Chainlink data feeds homepage, parses it to extract the JSON data embedded within, and then converts this data into a JSON response accessible via this API.
4 changes: 3 additions & 1 deletion apps/chainlink-datafeeds-api/app/api/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const HOUR_IN_S = 3600;

export async function GET() {
const res = await fetch("https://data.chain.link/feeds", {
next: { revalidate: 60 }, // Revalidate every 60 seconds
next: { revalidate: HOUR_IN_S },
});
const rawHTML = await res.text();

Expand Down
Binary file removed apps/chainlink-datafeeds-api/app/favicon.ico
Binary file not shown.
21 changes: 0 additions & 21 deletions apps/chainlink-datafeeds-api/app/layout.tsx

This file was deleted.

113 changes: 0 additions & 113 deletions apps/chainlink-datafeeds-api/app/page.tsx

This file was deleted.

1 change: 0 additions & 1 deletion apps/chainlink-datafeeds-api/public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion apps/chainlink-datafeeds-api/public/vercel.svg

This file was deleted.

0 comments on commit c8f0a7b

Please sign in to comment.