@@ -3,7 +3,8 @@ const path = require('path');
33const Barcode = require ( 'aspose-barcode-cloud-node' ) ;
44
55function makeConfiguration ( ) {
6- const envToken = process . env [ 'TEST_CONFIGURATION_JWT_TOKEN' ] ;
6+ const envToken = process . env [ 'TEST_CONFIGURATION_ACCESS_TOKEN' ] ;
7+ console . log ( "Start config" ) ;
78 if ( ! envToken ) {
89 return new Barcode . Configuration (
910 'Client Id from https://dashboard.aspose.cloud/applications' ,
@@ -15,14 +16,15 @@ function makeConfiguration() {
1516 return new Barcode . Configuration (
1617 null ,
1718 null ,
18- envToken ,
19- null
19+ null ,
20+ envToken
2021 ) ;
2122 }
2223}
2324const config = makeConfiguration ( ) ;
2425
2526async function generateBarcode ( api , fileName ) {
27+
2628 const imageParams = new Barcode . BarcodeImageParams ( ) ;
2729 imageParams . foregroundColor = "#FF0000" ;
2830 imageParams . backgroundColor = "#FFFF00" ;
@@ -44,10 +46,11 @@ async function generateBarcode(api, fileName) {
4446
4547 fs . writeFileSync ( fileName , generated . body ) ;
4648}
47-
4849const genApi = new Barcode . GenerateApi ( config ) ;
50+
4951const fileName = path . resolve ( 'testdata' , 'Code39.png' ) ;
5052
53+
5154generateBarcode ( genApi , fileName )
5255 . then ( ( ) => {
5356 console . log ( 'Barcode saved to ' + fileName ) ;
0 commit comments