I have a JavaScript script that is designed to read a JSON file containing all the navigation menu links for my web application. The menu tree structure looks like this:
1 - DASHBOARD - dashboard
2 - SETTINGS
2.1 - GENERAL - settings/general
2.2 - LAYOUT - settings/layout
3 - DATABASE
3.1 - QUERY
3.1.2 - EDITOR - database/query/editor
3.1.3 - TEST - database/query/test
This menu consists of three levels of nested links.
My challenge is in writing the links within the JSON file to prevent encountering a "not found" error, for example when navigating from "DASHBOARD" to "SETTINGS > GENERAL".
I am looking for a solution that does not involve using absolute paths, since my web application will be running in a virtual directory.