Skip to content

eemax/resolver

Repository files navigation

GS1 Product Resolver

A Cloudflare Worker implementation of a GS1 product resolver that follows the GS1 Digital Link standard, allowing users to access product information using URLs following the format:

domain.com/01/{EAN}/10/{Batch}

Introduction

This project implements a resolver for GS1 Digital Link URLs that can resolve product identifiers to relevant product information. The resolver follows the GS1 Application Identifier (AI) format:

  • 01 - The Application Identifier for GTIN/EAN
  • 10 - The Application Identifier for Batch/Lot number

GS1 Digital Link is a standard that makes it possible to connect physical products to the web using GS1 identifiers. The standard defines how to construct web URIs that link to product information.

Supported Formats

The resolver currently supports:

  1. GTIN/EAN with Batch: /01/{EAN}/10/{Batch}
  2. GTIN/EAN only: /01/{EAN}

Getting Started

Prerequisites

  • Node.js (v14 or later)
  • Wrangler CLI (Cloudflare Workers CLI)

Installation

  1. Install the Wrangler CLI:
npm install -g wrangler
  1. Clone this repository:
git clone https://github.com/yourusername/gs1-resolver.git
cd gs1-resolver
  1. Install dependencies:
cd cf-worker-js
npm install

Local Development

Run the worker locally:

npm start

This will start a local development server at http://localhost:8787.

Deployment

Deploy to Cloudflare Workers:

npm run deploy

Customization

To customize the resolver for your specific needs:

  1. Modify the worker logic in cf-worker-js/src/worker.ts
  2. Update the product information lookup to connect with your database or API
  3. Implement additional GS1 Application Identifiers as needed

License

This project is licensed under the MIT License - see the LICENSE file for details.

Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published