Coder Social home page Coder Social logo

curve-api's Introduction

Curve API

This API is used by various services to serve data. It is a public API intended for all those seeking to integrate Curve data onto their own projects.

Public REST API Endpoints

Endpoints list and example response can be found by clicking here

How to add a new endpoint

  1. Create a new file under /pages/api: the endpoint will be accessible through the same path, e.g. /pages/api/hithere would accessible through api.curve.fi/api/hithere
  2. If this endpoint requires passing any data as a query parameter, name that parameter in the path itself (e.g. /pages/api/user/[id].js)
  3. The endpoint script must export a function, wrapped in the utility fn(), that returns a json object โ€“ that's it
  4. Query params: any query params defined as in (2) are accessible in the first argument passed to fn, e.g. fn(({ id }) => ({ message: \Id passed as argument: ${id}`}))`
  5. Caching: pass an object as second argument to fn, and set the cache duration in seconds with the maxAge property: { maxAge: 60 }

Dev

Run: vercel dev

curve-api's People

Contributors

philippe-git avatar charlie-eth avatar dependabot[bot] avatar skellet0r avatar pioul avatar michwill avatar amfet42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.