Skip to content

Instantly share code, notes, and snippets.

@loloDawit
Created November 19, 2021 01:56
Show Gist options
  • Save loloDawit/cc98339e836921ba44c720fc79b7ebef to your computer and use it in GitHub Desktop.
Save loloDawit/cc98339e836921ba44c720fc79b7ebef to your computer and use it in GitHub Desktop.
src/common/config.js
/* eslint-disable no-undef */
"use strict";
module.exports = (options) => {
var config = {
method: "post",
url: `${process.env.URL}`,
headers: {
"Content-Type": "application/json",
"API-Key": `${process.env.NODE_ENV === "dev" ? process.env.API_KEY : process.env.API_KEY_PROD}`
},
data: options
};
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment