Skip to content

hsan8/Dokan-rest-API-with-node-JS-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8e78930 · Dec 12, 2020

History

2 Commits
Dec 12, 2020

Repository files navigation

install:
npm i node-fetch
in config.js
insert this code:
exports.dokan = { endpoint: 'https://www.test.com/wp-json/', header: { method: 'get', headers: { 'Cache-Control': 'no-cache', 'Authorization': 'Bearer INSERT_YOUR_TOKEN_HERE' }, } }

for routes file test.js
insert:

var config = require('./config.js'); var fetch = require('node-fetch');
exports.getAllStores = function(callback) { fetch(config.dokan.endpoint + 'dokan/v1/stores/3', config.dokan.header) .then(res => res.json()) .then(json => { callback(json); }); }

in test.js you can change dokan/v1/stores/3 with your custom API from https://wedevsofficial.github.io/dokan/

in index.js

var test = require('./test'); router.get('YOUR_TRIGGER_URL', function(req, res, next) { test.getAllStores(function(result) { res.send(result); }); });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published