sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
693 stars 766 forks source link

Create a CAP Business Service with Node.js Using Visual Studio Code #23426

Closed AndreasMuno closed 3 months ago

AndreasMuno commented 5 months ago

Tutorials: https://developers.sap.com/tutorials/cp-apm-nodejs-create-service.html

Write here how you think we can improve the tutorial Hi colleages,

in step 8 of this tutorial, at "Add persistent database", number 3, after creating the sqlite3 database, the text reads "This configuration is saved in your package.json as your default data source." But in fact, it is not. I had to find out about the missing part with the help of ChatGPT and add the respective part. It goes after { "name": "my-bookshop", "version": "1.0.0", "description": "A simple CAP project.", "repository": "", "license": "UNLICENSED", "private": true, "dependencies": { "@sap/cds": "^7", "express": "^4" },

 { "cds": {
    "requires": {
        "db": {
          "kind ": "sqlite",
          "model": [
            "db/",
            "srv/"
        ],
        "credentials": {
           "database": "db/my-bookshop.db",
           "url": "sqlite.db"
        }
      }
    }
  }
, ...
}

Only after this addition to the package.json file did 'cds watch' pick up on the database and showed [cds] - connect to db > sqlite { url: 'sqlite.db', database: 'db/my-bookshop.db' }.

Thank you. 2024-02-04_Tutorial_Screenshot

renejeglinsky commented 3 months ago

Hi @AndreasMuno , I'm sorry for picking your issue so late. I'll look into it and get back to you then. Thanks for reporting! All the best, René

renejeglinsky commented 3 months ago

Hi @AndreasMuno , I adapted the tutorial here: https://github.com/sap-tutorials/Tutorials/pull/23507/commits/7e8f0650eb262614a4aa273e7a86e162d1a48721 Thanks again for reporting!

All the best, René