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}
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/EAN10
- 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.
The resolver currently supports:
- GTIN/EAN with Batch:
/01/{EAN}/10/{Batch}
- GTIN/EAN only:
/01/{EAN}
- Node.js (v14 or later)
- Wrangler CLI (Cloudflare Workers CLI)
- Install the Wrangler CLI:
npm install -g wrangler
- Clone this repository:
git clone https://github.com/yourusername/gs1-resolver.git
cd gs1-resolver
- Install dependencies:
cd cf-worker-js
npm install
Run the worker locally:
npm start
This will start a local development server at http://localhost:8787.
Deploy to Cloudflare Workers:
npm run deploy
To customize the resolver for your specific needs:
- Modify the worker logic in
cf-worker-js/src/worker.ts
- Update the product information lookup to connect with your database or API
- Implement additional GS1 Application Identifiers as needed
This project is licensed under the MIT License - see the LICENSE file for details.