NFT Server

Simple rust lib for NFT Metadata, and a basic axum server for delivering it

$ cargo build $ cargo clippy $ cargo run --bin example

Usage

Implement a MetadataGenerator that asynchronously maps a token ID to token metadata, then call serve to serve it. See bin/example.rs as well as the crate::generators::disk::LocalJson generator

Consuming crates need to depend on the following:

Built-in server

The axum feature (on by default) adds a minimal axum server preconfigured to serve token metadata.

After instantiating your metadata generator, you can serve it over http as follows:

```rust use nft_server::prelude::*;

async main() { let mygenerator = ...; let addr = ([0, 0, 0, 0], 8080); servegenerator(my_generator, addr).await; } ```

This server has the following routes:

e.g. localhost:8080/0 will return json metadata for token 0