Closed mikelei8291 closed 6 years ago
AriaNg is a single page web page. Every sub page can be navigated to through "#!" link.
Why not let every sub page directly under the first level path?
For example:
https://example.com/downloading
Instead of:
https://example.com/#!/downloading
Is this actually because of the Location Strategy of your code? If so, please use the "HTML5 pushState" strategy, because it's the style for modern browsers.
Learn more in this guide: https://angular.io/guide/router#appendix-locationstrategy-and-browser-url-styles
Moreover, the old "Hash Location Strategy" style will not make the browser send the request to the server, so the command line API is actually not usable, unless you access the url directly form the address bar of the browser.
Yes, AriaNg is not dependent on server-side environment, so it is no need to request server. You can directly navigate command API in the browser to use them.
So how do I make a xhr request to the command line API?
You cannot use xhr to request command line API. Command API should be accessed by url in browser only.
So what is the propose of the command line API? Do you think it's a convenient thing for people to encode the url to base64 and construct the link for the command line API? I originally suppose the command line API is used for scripting and automation.
Obviously,the command API is designed for executing some AriaNg methods through a third-party program. AriaNg is NOT a server-side app, but a single web page in browser. You cannot request API directly like server-side app, but build a completed url based on AriaNg command API specification and let user access these urls.
The path "/#!/" makes no sense here but prevents me send xhr requests to the command line api, because the string after the # is ignored by the browser, please remove it.