I use this api to track my domains across various registrars.
It is licensed under MIT, so feel free to use it for any project and of course please feel free to raise issues and contribute through pull requests.
Demo (hosted on heroku free plan - available 18h/day)
Clone this repository to your development machine:
git clone https://github.com/iRomain/domain-tracker-api.git
Enter the newly created directory:
cd domain-tracker-api
Install NPM dependencies:
npm install
Run npm run dev-start
, it will automatically test, lint and start your API, watching any modification and re-linting/starting with nodemon.
NPM sets the environment variable NODE_ENV=dev
Use TDD:
- Write a test in
./test/
- Add your endpoint in
./lib/api.js
- Run
npm run dev-start
You can see your API on http://localhost:3000 and see its documentation on http://localhost:3000/documentation
This API is compatible with Travis.
It sets the environment variable NODE_ENV=test
Add this repo (which you most likely forked already):
- Sync Travis with your Github account and add this repo
- Push your repo (if you didn't change/remove the
deploy
part, it will fail at deployment)
This API is compatible with Code Climate through the Travis/Code Climate integration
- Add this repo to Code Climate and get the repo token
- Edit the
addons.code_climate.repo_token
in .travis.yml Tip: Use Travis to encrypt your token withtravis encrypt <token> --add addons.code_climate.repo_token
This API is also compatible with Codacy
This API is compatible with Heroku through the Travis/Heroku integration.
Create a new app on Heroku:
Change the Deploy configuration in .travis.yml:
- Change your
deploy.app
name- Change your
deploy.api_key
Tip: Use Travis to encrypt your api key withtravis encrypt <api key> --add deploy.api_key
Push to GitHub:
- Watch the build in Travis
- Watch the deployment in Heroku
- Your API is now available on
https://<app name>.herokuapp.com/documentation
A Docker image is automatically built by using the Travis/Docker integration. It could be setup with docker hub automated build functionality but I prefer how everything can be configured in .travis.yml close to the code.
Change the Docker image build configuration in .travis.yml:
- Change your image repo in
before_install
for both the build and push commands- Change your encrypted docker password with
travis encrypt DOCKER_PASSWORD="<docker password>" --add
This API is compatible with New Relic through the Heroku/New Relic integration
- Add the New Relic element to your app
- Edit the
app_name
in newrelic.js with your heroku app name (recommended but could be any name)- Edit the
logging.level
in newrelic.js to suit your desired logging level
Original credits to: iRomain/api-bootstrap