The application consumes a string and returns its validity as an IBAN number
Deployed on Heroku at: https://iban-service.herokuapp.com
The Open API 3 docs will be available on /docs
route. Read the hosted docs here.
curl -X 'GET' \
'https://iban-service.herokuapp.com/verify?iban=GB82WEST12345698765432' \
-H 'Authorization: Basic ZGV2OmRldg=='
The response should be {"result":"valid"}
curl -X 'GET' \
'https://iban-service.herokuapp.com/verify?iban=GB82WEST12345698765431' \
-H 'Authorization: Basic ZGV2OmRldg=='
The response should be {"result":"invalid","reason":"Check digits are errornous"}
- The application is in Node.js because it is my primary language.
- The countries supported are the ones defined in the spec file. More countries can be added trivially.
Unless the application is run with docker, the system needs to have node.js
v14 and npm
v7.
npm i
or make build
npm t
will run the tests using tap
. You can also run make test
.
npm run dev
or make run
runs the server in dev mode using nodemon. It should just work.
npm start
is more proper way to start the application.
The /verify
route is behind basic authorization. Default username/password is dev:dev
.
env | default |
---|---|
PORT | 3000 |
NODE_ENV | local |
BASIC_AUTH_USERNAME | dev |
BASIC_AUTH_PASSWORD | dev |