# 🛡️ DID Proxy Resolver
This project is a simple **Node.js + Express** proxy API that resolves `did:tgrid` identifiers by internally calling a DID resolver running on `http://localhost:3000`.
It exposes an endpoint:
GET /1.0/identifiers/:identifier
Which internally calls:
GET http://localhost:3000/resolve?did=did:tgrid:trustgrid:dev:
## 📁 Project Structure
did-proxy-resolver/ ├── controllers/ │ └── Default.js ├── index.js ├── package.json ├── Dockerfile └── README.md
---
## 🚀 How to Run
### 1. Install dependencies
```bash
npm install
node index.js
Server runs at http://localhost:8080
Call this proxy endpoint:
curl http://localhost:8080/1.0/identifiers/QjA1qdXKmxzgK4u8mFoBpF
It will internally send a request to:
http://localhost:3000/resolve?did=did:tgrid:trustgrid:dev:QjA1qdXKmxzgK4u8mFoBpF
And return the resolved DID Document.
docker build -t did-proxy .
docker run -p 8080:8080 did-proxy
If you're running the DID resolver (on port 3000
) and this proxy together:
version: '3.8'
services:
resolver:
image: your-did-resolver-image
build:
context: ./resolver
ports:
- "3000:3000"
proxy:
build: .
ports:
- "8080:8080"
depends_on:
- resolver
Make sure to update controllers/Default.js
to call:
const url = `http://resolver:3000/resolve?did=...`
instead of localhost
.
Srikanth Hubli Feel free to use, improve, and contribute.
MIT License. Free to use and modify.
---