It's recommended that you install and use Homebrew for the system-level requirements for the project. Once you have it installed, you can run the following:
brew tap homebrew/services
brew install node mysql [email protected] bcrypt redis
Please use the requirement links above to review install instructions for each dependency.
npm install -g forever
Once you have downloaded the API you will need to create some config files for the local installation.
The possible environment options are local
, mobile
, staging
, production
, test
& docker
.
There are two config files you will need to initial create. Using the name of the environment you wish to setup.
For example, if you are setting up a local
environment, you would need to create ./app/config/db-local.json
& ./app/config/local.json
.
{
"debug": true,
"env": "local",
"secret": "F8E1577B-DDAF-8234-4DD5-9301E7223582",
"sessionKey": "F41CF60C-9A23-55C4-DDE3-7642B13B6276",
"debugKey": "BD52B1DC-C396-A714-B5B4-21AE9B6A0971",
"bugsnag": "",
"hashID": {
"secret": "4B1AB909-EA83-4E34-3D43-280273497137"
},
"database": {
"api": {
"host": "localhost",
"database": "civil_services_api",
"username": "root",
"password": ""
}
},
"mandrill": {
"key": "CHANGE_ME"
},
"ipinfodb": {
"key": "CHANGE_ME"
},
"openStates": {
"key": "CHANGE_ME"
},
"elasticsearch": {
"log": "error"
},
"logzio": {
"token": "CHANGE_ME",
"type": "CivilServiceAPI"
}
}
{
"username": "root",
"password": "",
"database": "civil_services_api",
"host": "localhost",
"dialect": "mysql"
}
cd /path/to/api
export API_NODE_ENV=local && npm start
Once the API is up and running you can access a local URL via:
http://localhost:5000/v1/geolocation/zipcode/10001?apikey=7E07D864-209A-F9E4-819F-2DD7E76B6F24&pretty
The default API Key for Development is 7E07D864-209A-F9E4-819F-2DD7E76B6F24
so you can just append ?apikey=7E07D864-209A-F9E4-819F-2DD7E76B6F24
to any API endpoint for authentication.