Skip to content

Instantly share code, notes, and snippets.

View IAmRC1's full-sized avatar
🏠
Working from home

Rishabh Singh IAmRC1

🏠
Working from home
View GitHub Profile
@IAmRC1
IAmRC1 / apiConfig.js
Created August 4, 2021 13:49
Axios-DRY
const baseURL = 'https://gorest.co.in/public-api'
const token = 'jwt-token'
const apiConfig = (url, method = 'get', isTokenIncluded = false, params = {}, data = {}) => {
if(isTokenIncluded){
return {
url,
method,
baseURL,
headers: {
@IAmRC1
IAmRC1 / proxy.js
Created May 25, 2020 10:40
Proxy for php
/**
* Failed to minify the file using UglifyJS v3.4.3. Serving the original version.
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
console.log('hello')
const express = require('express');
const url = require('url');
const cors = require('cors');
const request = require('request');