This is a set of RESTful APIs built in Node.js to create and maintain the campaigns.
POST - Create a campaign
GET - Get all campaigns
GET - Get a campaign by id
DELETE - Delete a campaign
POST - Compute campaign statistics
POST - Compute merchant statistics
-
Install Node version 8.1.3
-
Install Python V2.7 Install Python version 2.7. To check if python is already present, use the cmd 'which python'
-
Install Oracle instant clients
- Download the oracle instant clients instantclient-basic-linux.x64-12.1.0.2.0.zip and instantclient-sdk-linux.x64-12.1.0.2.0.zip
- Execute : cd /data/oracle
- Execute : unzip instantclient-basic-linux.x64-12.1.0.2.0.zip
- Execute : unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip
- Execute : mv instantclient_12_1 instantclient
- Execute : cd instantclient
- Execute : ln -s libclntsh.so.12.1 libclntsh.so
- Execute : ln -s libocci.so.12.1 libocci.so
- Execute : export LD_LIBRARY_PATH=/data/oracle/instantclient
- Execute : export OCI_LIB_DIR=/data/oracle/instantclient
- Execute : export OCI_INC_DIR=/data/oracle/instantclient/sdk/include
- To get the xls_campaign_api project to your machine, Git clone <git_project_repository>
- To download npm modules, run command "npm install" from the src directory of xls_campaign_api
- To start xls_campaign_api server, run command, "npm run startXLSCAMPAIGNAPIServer"
- To stop xls_campaign_api server, run command, "npm run stopXLSCAMPAIGNAPIServer"
- To run unit tests, run command, "npm run unitTest"
- To run integration tests using newman, follow the below steps,
a. Start xls_campaign_api server
c. Run the command "npm run integrationTest" in another command window.
In order to view the integration test report (generated by newman) in Jenkins through HTML publisher, do the following steps.
CSS is striped because of the Content Security Policy in Jenkins. (https://wiki.jenkins-ci.org/display/JENKINS/Configuring+Content+Security+Policy)
The default rule is set to: sandbox; default-src 'none'; img-src 'self'; style-src 'self';
This rule set results in the following:
No JavaScript allowed at all
No plugins (object/embed) allowed
No inline CSS, or CSS from other sites allowed
No images from other sites allowed No frames allowed
No web fonts allowed No XHR/AJAX allowed etc.
To relax this rule, go to Manage Jenkins->Script console and type in the following command :
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
and Press Run. If you see the output as 'Result:' below "Result" header then the protection disabled. Re-Run your build and you can see that the new HTML files archived will have the CSS enabled.