I need to use casperjs to solve cloudflare under attack http get request issue, to call Rest api from client app, I win to call it in casperjs module, but it runs from command line when put code in separate js file, and use it like:
> casperjs sample.js
now I need to use it in my code to call http request,
such as in angularjs, I use ionic framework,
I cannot import library like this: var casper = require('./lib/casperjs').create();
that is /casperjs is a folder inside ./lib/ folder, I get it from this command:
npm install casperjs
I face this error: Error: Module name "lib/casperjs" has not been loaded yet for context
now how to fix this to gets work on my code, what is needed ?