mayswind / AriaNg

AriaNg, a modern web frontend making aria2 easier to use.
http://ariang.mayswind.net
MIT License
11.91k stars 1.3k forks source link

Remove /#!/ in ariaNg url #223

Closed mikelei8291 closed 6 years ago

mikelei8291 commented 6 years ago

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.

mayswind commented 6 years ago

AriaNg is a single page web page. Every sub page can be navigated to through "#!" link.

mikelei8291 commented 6 years ago

Why not let every sub page directly under the first level path? For example: https://example.com/downloading Instead of: https://example.com/#!/downloading

mikelei8291 commented 6 years ago

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

mayswind commented 6 years ago

qq 20180412213311

mikelei8291 commented 6 years ago

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.

mayswind commented 6 years ago

qq 20180412231331 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.

mikelei8291 commented 6 years ago

So how do I make a xhr request to the command line API?

mayswind commented 6 years ago

You cannot use xhr to request command line API. Command API should be accessed by url in browser only.

mikelei8291 commented 6 years ago

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.

mayswind commented 6 years ago

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.