Skip to content

Instantly share code, notes, and snippets.

View cassmtnr's full-sized avatar
☀️
Praise the Sun

Cassiano cassmtnr

☀️
Praise the Sun
  • DKB Code Factory GmbH
  • Leipzig, Germany
  • 14:20 (UTC +02:00)
View GitHub Profile
@cassmtnr
cassmtnr / axios-interceptors-refresh-token.js
Created April 2, 2019 17:52 — forked from mkjiau/axios-interceptors-refresh-token.js
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@cassmtnr
cassmtnr / aws-s3.js
Created January 26, 2018 12:26 — forked from wharley/aws-s3.js
upload
'use strict'
const AWS = require('aws-sdk')
const env = require('../../.env')
const formidable = require('formidable')
const fs = require('fs')
const sendErrorsFromDB = (res, dbErros) => {
const errors = []
_.forIn(dbErros.errors, error => errors.push(error.message))
return res.status(400).json({ errors })