const ONDC = require('ondc-node');
const express = require("express");
const app = express();
app.use(express.json());
app.use(ONDC.Middleware({"on_search": onSearchHandler, "init": initHandler}));
const ondc = require('ondc-node');
const instance = new ondc.ONDC({
host: "http://localhost:5000",
bapId: "bap.com",
bapUri: "https://bap.com/beckn",
bppId: "bpp.com",
bppUri: "https://bpp.com/beckn",
country: "IND",
city: "std:080",
ttl: "P1M"
});
const response = await instance.search({
"item": {
"descriptor": {
"name": "ABC Aata"
}
},
"fulfillment": {
"end": {
"location": {
"gps": "12.4535445,77.9283792"
}
}
}
})