Skip to content

gulshanvas/rapid_api_integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


rapid_api_integration

Pre-requisites

  1. Node(>=11.12.0) and npm(>=6.7.0) installed
  2. mysql server and memcache server

Guide to setup

  1. Get the maxmind key [maxmind.com].
  2. Run below command by replacing <YOUR_LICENSE_KEY> with your personal key :
cd node_modules/geoip-lite && npm run-script updatedb license_key=YOUR_LICENSE_KEY
  1. Create database in mysql server by running below command :
create database news_analysis
  1. Run npm install
  2. Run below command to run migrations :
npm run migrations
  1. Start memcache server :
memcached -p 11211 -d
  1. Open the terminal and set the environment variables(On mac).
source environment.sh
  1. Import apis present under postman folder in postman application.
  2. Start the server by running below command :
node app.js

Overview:

  1. For get-news api, node-cache is used to cache the response for 24-hours.
  2. For get-news-analysis api, memcache is used to cache the response.
  3. There is a background script which fetches the top symbol request in minutes(configured in environment variable POPULAR_SYMBOL_VS_COUNTRY_COUNT) and updates the cache.
  4. For both the apis, worst case response time is 150ms and average is less than 100ms.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published