From e78ab2e2b8b3d80dae07ed863ca7f5737a7c820e Mon Sep 17 00:00:00 2001 From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com> Date: Mon, 1 Feb 2021 13:32:18 +0100 Subject: [PATCH] update import of moke data --- .../launch_local_application.md | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/ecolyo/getting_started/launch_local_application.md b/docs/ecolyo/getting_started/launch_local_application.md index 615851b..e320636 100644 --- a/docs/ecolyo/getting_started/launch_local_application.md +++ b/docs/ecolyo/getting_started/launch_local_application.md @@ -142,12 +142,7 @@ First install ACH using yarn : yarn global add cozy-ach ``` -Next launch the script **createDayDataFiles.js** available into **scripts** folder - -``` -cd scripts -node createDayDataFiles.js -``` +Next create the "config.js" file base on the "config.template.js" !!! info "" You can change the period of data generated by changing the following lines: @@ -163,6 +158,13 @@ You can change the period of data generated by changing the following lines: Just replace -120 by the value needed +Next launch the script **createDayDataFiles.js** available into **scripts** folder + +``` +cd scripts +node createDayDataFiles.js +``` + Json files with data will be created into **scripts/data** folder. ACH script "importData.bat" will load the content of the file into your couchDB (database of your dev stack). Launch it using following commands: @@ -186,11 +188,12 @@ Your dev stack should be running to import data needed to simulate konnectors co When using local environment, konnectors are not able to connect. To simulate the connection you can use the script **createConnection.js** available in **scripts** folder. -First update the Bearer and cozysessid information from the script: +First update the authorization and cookie information from the "config.js" file (if not create just create it from the "config.template.js" file): ``` - Authorization: - 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', - Cookie: 'cozysessid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', + const authorization = + 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +const cookie = + 'cozysessid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ``` To obtain your own Bearer and cozysessid you need to have the application launched and display the web console (F12) in your navigator and select the Network tab. Just select one request and retrieve information for Request Header: -- GitLab