mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-02-24 11:33:09 +01:00
Add support for environment variables
This commit is contained in:
parent
e3b4cfd3b2
commit
28d8d172f7
@ -29,8 +29,7 @@ const PageFooter = () => (
|
||||
<li className='foot-header'>Contribute</li>
|
||||
<li><a href={ siteConfig.url.addGuide } target="_blank">Write a Guide</a></li>
|
||||
<li><a href={ siteConfig.url.addRoadmap } target="_blank">Submit a Roadmap</a></li>
|
||||
<li><a href={ siteConfig.url.addResources } target="_blank">Add resources</a></li>
|
||||
<li><a href={ siteConfig.url.repo } target="_blank">Codebase</a></li>
|
||||
<li><a href='/about'>About this Site</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div className="site-learn foot-col col-12 col-sm-4 col-lg-2">
|
||||
|
@ -11,7 +11,6 @@ const SiteNav = () => (
|
||||
<div className='nav-links'>
|
||||
<a href='/roadmaps'>Roadmaps</a>
|
||||
<a href='/guides'>Guides</a>
|
||||
<a href='/about' className='d-none d-md-inline-block'>FAQ</a>
|
||||
<a href='/signup' className='d-none d-md-inline-block'>Subscribe</a>
|
||||
</div>
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"GA_SECRET": ""
|
||||
}
|
@ -20,14 +20,20 @@ const { getPathMap } = require("./scripts/path-map");
|
||||
const loadConfig = (env = 'dev') => {
|
||||
const configPath = `./config/${env}.json`;
|
||||
if (!fs.existsSync(configPath)) {
|
||||
console.log(`Config file not found: ${configPath}`);
|
||||
process.exit(1);
|
||||
console.warn(`Config file not found: ${configPath}. Using environment variables only.`);
|
||||
}
|
||||
|
||||
const appConfig = {};
|
||||
|
||||
for (let key in process.env) {
|
||||
if (!key.startsWith('ROADMAP_')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
appConfig[key.replace('ROADMAP_', '')] = process.env[key];
|
||||
}
|
||||
|
||||
console.log(`Config file found: ${configPath}`);
|
||||
|
||||
// @todo stringify the values for webpack - it doesn't understand objects
|
||||
return require(configPath);
|
||||
return appConfig;
|
||||
};
|
||||
|
||||
const options = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user