@@ -30,29 +30,63 @@ export class Generator extends ServiceGenerator {
3030 var : 'PLT_KAFKA_BROKER' ,
3131 label : 'Which is the address of one of the Kafka brokers?' ,
3232 default : 'localhost:9092' ,
33- type : 'string'
33+ type : 'string' ,
34+ configValue : 'broker'
3435 } ,
3536 {
3637 var : 'PLT_KAFKA_TOPIC' ,
3738 label : 'Which Kafka topic do you want to use?' ,
3839 default : 'events' ,
39- type : 'string'
40+ type : 'string' ,
41+ configValue : 'topic'
4042 } ,
4143 {
4244 var : 'PLT_KAFKA_URL' ,
4345 label : 'Which URL you want to forward messages to?' ,
4446 default : 'http://localhost:3000' ,
45- type : 'string'
47+ type : 'string' ,
48+ configValue : 'url'
4649 } ,
4750 {
4851 var : 'PLT_KAFKA_CONSUMER_GROUP' ,
4952 label : 'Which Kafka consumer group do you want to use?' ,
5053 default : 'plt-kafka-hooks-consumer' ,
51- type : 'string'
54+ type : 'string' ,
55+ configValue : 'consumerGroup'
5256 }
5357 ]
5458 }
5559
60+ async prepareQuestions ( ) {
61+ this . questions . push ( {
62+ type : 'input' ,
63+ name : 'broker' ,
64+ message : 'Which is the address of one of the Kafka brokers?' ,
65+ default : 'localhost:9092'
66+ } )
67+
68+ this . questions . push ( {
69+ type : 'input' ,
70+ name : 'topic' ,
71+ message : 'Which Kafka topic do you want to use?' ,
72+ default : 'topic'
73+ } )
74+
75+ this . questions . push ( {
76+ type : 'input' ,
77+ name : 'url' ,
78+ message : 'Which URL you want to forward messages to?' ,
79+ default : 'http://localhost:3000'
80+ } )
81+
82+ this . questions . push ( {
83+ type : 'input' ,
84+ name : 'consumerGroup' ,
85+ message : 'Which Kafka consumer group do you want to use?' ,
86+ default : 'consumerGroup'
87+ } )
88+ }
89+
5690 async generatePackageJson ( ) {
5791 const template = await super . generatePackageJson ( )
5892
0 commit comments