danielthepope / trntxt

:steam_locomotive::train::train: A data-friendly UK train times site
https://trntxt.uk
MIT License
36 stars 9 forks source link

Feature/git friendly config #11

Closed Birch-san closed 9 years ago

Birch-san commented 9 years ago

Regarding:

 9 | var apiKey = process.env.APIKEY; // Imported from Azure
10 | apiKey = "********-****-****-****-************"; // DON'T COMMIT THIS
11 | var soapUrl = 'https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2014-02-20';

Whenever you make a commit, make sure you don't commit that line! Also, if you know of a better way to set the key during development, please let me know!

You now put your nominal config into ./config/config.example.js:

module.exports = {
    apiKey: process.env.APIKEY
};

This will be versioned, and can be checked into git.

Departures from this nominal config are extended on from ./config/config.js. This is a .gitignore’d file that will be created (if not existent already) at build-time.

danielthepope commented 9 years ago

Looks good Alex :) I'll test it out and merge it when I next have some time to work on this (probably Tuesday)