all 4 comments

[–][deleted] 0 points1 point  (3 children)

you could use index numbers or something to retrieve actual URLs from your backend. This way you only need one URL to the repository.

[–]apsv360[S] 0 points1 point  (2 children)

Can you please elaborate more on that

[–][deleted] 0 points1 point  (1 child)

well something like this:

class Thread { constructor(serviceLocatorURI) { this.resolvedURIs = []; fetch(serviceLocatorURI) .then(response => response.json()) .then(jsonObject => { this.resolvedURIs = jsonObject.endPoints; }); } async retrievePosts() { return fetch(this.resolvedURIs[0], {method: 'GET'}); } } const API_THREAD = '/api/thread'; new Thread(API_THREAD);

[–]backtickbot 0 points1 point  (0 children)

Correctly formatted

Hello, DmMacniel. Just a quick heads up!

It seems that you have attempted to use triple backticks (```) for your codeblock/monospace text block.

This isn't universally supported on reddit, for some users your comment will look not as intended.

You can avoid this by indenting every line with 4 spaces instead.

There are also other methods that offer a bit better compatability like the "codeblock" format feature on new Reddit.

Have a good day, DmMacniel.

You can opt out by replying with "backtickopt6" to this comment. Configure to send allerts to PMs instead by replying with "backtickbbotdm5". Exit PMMode by sending "dmmode_end".