const config = {
name: "home1",
host: "https://b2ads.ad5track.com",
path: "/ad_products/top",
method: "GET",
properties: [
{ from: "headers.referrer", to: "query.referrer" },
{ from: "query.size" , to: "query.limit"},
{ from: "query.userId" , to: "query.user_id"}
]
}
const apiAdapter = new ApiAdapter(config)
console.log(apiAdapter.fromApi({
headers: { referrer: "http://www.americanas.com "},
query: { size: 10, userId: 30, term: "notebook"}
}))
-
Notifications
You must be signed in to change notification settings - Fork 0
node-tools/api-adapter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A lib to convert request-response pair of different contracts, load a translate description from a config
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published