nodejs-template icon indicating copy to clipboard operation
nodejs-template copied to clipboard

npm start does not start the generated application.

Open freakfan15 opened this issue 2 years ago • 2 comments

Describe the bug

  • I was going through the official docs to generate code here.
  • npm install and npm start doesn't start the genrerated server inside output dir.

How to Reproduce

  • used this command asyncapi generate fromTemplate asyncapi.yaml @asyncapi/nodejs-template -o output -p server=mosquitto to generate the application
  • used the asyncapi.yaml file from the streetlight eg in the docs here
  • when I do npm start, the server does not start as mentioned in the docs. image

Expected behavior

  • when i went in the output/src/api/index.js file i didn't see the init function being called anywhere. So, I added client.init() and it started as expected.

image image

  • I see the client being exported, but according to the docs, just npm start should start the app. That is why raising the issue. Thanks.

freakfan15 avatar Nov 04 '23 07:11 freakfan15

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

github-actions[bot] avatar Nov 04 '23 07:11 github-actions[bot]

@freakfan15 hey, you link to https://www.asyncapi.com/docs/tutorials/create-asyncapi-document but it is a document that only explains how to create AsyncAPI document and had nothing to do with this template

Nevertheless I see we have a bug in docs, and also the npm start command is in fact not updated because this template no longer generate an app but a library and you should follow https://github.com/asyncapi/nodejs-template?tab=readme-ov-file#adding-custom-code--handlers to actually test how it works

@freakfan15 would you like to contribute needed changes?

derberg avatar Feb 14 '24 09:02 derberg

closing, it is old docs related issue, v3 has different starting commadn asyncapi new glee --name=tutorial --template tutorial

derberg avatar May 07 '24 13:05 derberg