Giter Site home page Giter Site logo

client-1's Introduction

Ordinal News Standard

This repository contains a simple web interface and API for creating, viewing, and interpreting inscriptions that follow the Ordinal News Standard.

Visit inscribe.news to see it in action!

API Endpoints

The API fetches info, content, or news from an inscription ID, grabbing the data from the Hiro Ordinals API with either ordapi.xyz or ordinals.com as a fallback, then saving it in KV for future requests.

  • /api/info/INSCRIPTION_ID - returns inscription data (all)
  • /api/content/INSCRIPTION_ID - returns inscription content (all)
  • /api/news/INSCRIPTION_ID - returns html from news inscription body (news only)
  • /api/data/INSCRIPTION_ID - returns inscription data and content (news only)
  • /api/data/ord-news - returns all known news inscriptions in KV
  • /api/data/ord-list - returns all known inscriptions in KV

Development

This repository can be cloned and hosted with an active Cloudflare account, using Cloudflare Pages.

To develop the site locally, run:

npm i
npm run build
npx wrangler pages dev dist/

To develop the site locally with KV enabled:

npx wrangler pages dev --kv ORD_LIST --kv ORD_NEWS --kv ORD_DATA --local ./public ./dist

Cloudflare Configuration

In order to setup the same environment, a few Cloudflare settings need to be enabled on the dashboard for this Pages project.

Builds & Deployments

  • Build command: npm run build
  • Build output directory: /dist
  • Root directory: /

Environment Variables

Production:

  • NODE_VERSION 17

Preview:

  • NODE_VERSION 17

KV

Create KV namespaces:

  • ord-list
  • ord-news
  • ord-data
  • ord-list-preview
  • ord-news-preview
  • ord-data-preview

Functions

Usage model: Unbound

KV namespace bindings:

  • Production:
    • ORD_LIST = ord-list
    • ORD_NEWS = ord-news
    • ORD_DATA = ord-data
  • Preview:
    • ORD_LIST = ord-list-preview
    • ORD_NEWS = ord-news-preview
    • ORD_DATA = ord-data-preview

client-1's People

Contributors

whoabuddy 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.