Using Google libphonenumber with JS
This is a Node.js app that uses libhphonenumber library to parse phone numbers.
Before you proceed, please ensure that you have downloaded and installed Node.js from nodejs.org.
- Download this repo
- Navigate inside it with command-line, and install all the packages:
npm install
- Run the server by typing:
npm run dev
It should show you the following:
Now you can access the API endpoints. To do that, you can use Fiddler or Postman. The screenshots below capture work process on Postman and results.
As of now, GET works only with one number.
Url to test: localhost:8000/api/phonenumbers/parse/text/testparser+14445556677
Make sure you have GET as request method and included "application/json" for "Content-Type" before sending request:
Url to test: localhost:8000/api/phonenumbers/parse/file
Make POST as request method, change "Content-Type" to "multipart/form-data", and include the file before sending request:
First, make sure your server is not running because it will prevent tests from running.
Assuming you are still in the root of project, run this command:
npm test
It will show you the following in the command-line:
Please navigate to Issues page at the top of repo.