0.0.4 • Published 3 years ago

shotgun-js v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

ShotgunJS

docs

  • config in init file
const urlRoot = {
  hostApi: "https://<replaceme>/api/v1",
};
SHOTGUN.interceptors.request.use((config) => {
  config.url = urlRoot.hostApi + config.url;
  return config;
});

SHOTGUN.interceptors.request.use(async (config) => {
// getAuth() should return accesstoken
  const header = await getAuth()
  config.headers["Authorization"] = header.Authorization
  return config;
});
  • Import in other files
import SHOTGUN from "shotgun-js"
0.0.2

3 years ago

0.0.4

3 years ago

0.0.1

3 years ago